<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621681056522"></span><span class="hs-pragma">{-# LANGUAGE GADTs, BangPatterns, RecordWildCards,
    GeneralizedNewtypeDeriving, NondecreasingIndentation, TupleSections,
    ScopedTypeVariables, OverloadedStrings #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Cmm.Info.Build</span><span>
</span><span id="line-6"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier">CAFSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFEnv"><span class="hs-identifier">CAFEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafAnal"><span class="hs-identifier">cafAnal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafAnalData"><span class="hs-identifier">cafAnalData</span></a></span><span>
</span><span id="line-7"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#doSRTs"><span class="hs-identifier">doSRTs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier">ModuleSRTInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#emptySRT"><span class="hs-identifier">emptySRT</span></a></span><span>
</span><span id="line-8"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTMap"><span class="hs-identifier">SRTMap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#srtMapNonCAFs"><span class="hs-identifier">srtMapNonCAFs</span></a></span><span>
</span><span id="line-9"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Enum.html#succ"><span class="hs-identifier">succ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Block</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Graph</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Label</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html"><span class="hs-identifier">GHC.Cmm.Dataflow</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html"><span class="hs-identifier">GHC.Data.Graph.Directed</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Heap.html"><span class="hs-identifier">GHC.StgToCmm.Heap</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Monad.html"><span class="hs-identifier">GHC.CmmToAsm.Monad</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Config.html"><span class="hs-identifier">GHC.CmmToAsm.Config</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Strict.html#"><span class="hs-identifier">Data.Map.Strict</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier">Map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Strict.html#"><span class="hs-identifier">Data.Map.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier">Set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.html#"><span class="hs-identifier">Control.Monad.Trans.State</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#unzip4"><span class="hs-identifier">unzip4</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">{- Note [SRTs]

SRTs are the mechanism by which the garbage collector can determine
the live CAFs in the program.

Representation
^^^^^^^^^^^^^^

+------+
| info |
|      |     +-----+---+---+---+
|   --------&gt;|SRT_2| | | | | 0 |
|------|     +-----+-|-+-|-+---+
|      |             |   |
| code |             |   |
|      |             v   v

An SRT is simply an object in the program's data segment. It has the
same representation as a static constructor.  There are 16
pre-compiled SRT info tables: stg_SRT_1_info, .. stg_SRT_16_info,
representing SRT objects with 1-16 pointers, respectively.

The entries of an SRT object point to static closures, which are either
- FUN_STATIC, THUNK_STATIC or CONSTR
- Another SRT (actually just a CONSTR)

The final field of the SRT is the static link field, used by the
garbage collector to chain together static closures that it visits and
to determine whether a static closure has been visited or not. (see
Note [STATIC_LINK fields])

By traversing the transitive closure of an SRT, the GC will reach all
of the CAFs that are reachable from the code associated with this SRT.

If we need to create an SRT with more than 16 entries, we build a
chain of SRT objects with all but the last having 16 entries.

+-----+---+- -+---+---+
|SRT16| | |   | | | 0 |
+-----+-|-+- -+-|-+---+
        |       |
        v       v
              +----+---+---+---+
              |SRT2| | | | | 0 |
              +----+-|-+-|-+---+
                     |   |
                     |   |
                     v   v

Referring to an SRT from the info table
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following things have SRTs:

- Static functions (FUN)
- Static thunks (THUNK), ie. CAFs
- Continuations (RET_SMALL, etc.)

In each case, the info table points to the SRT.

- info-&gt;srt is zero if there's no SRT, otherwise:
- info-&gt;srt == 1 and info-&gt;f.srt_offset points to the SRT

e.g. for a FUN with an SRT:

StgFunInfoTable       +------+
  info-&gt;f.srt_offset  |  ------------&gt; offset to SRT object
StgStdInfoTable       +------+
  info-&gt;layout.ptrs   | ...  |
  info-&gt;layout.nptrs  | ...  |
  info-&gt;srt           |  1   |
  info-&gt;type          | ...  |
                      |------|

On x86_64, we optimise the info table representation further.  The
offset to the SRT can be stored in 32 bits (all code lives within a
2GB region in x86_64's small memory model), so we can save a word in
the info table by storing the srt_offset in the srt field, which is
half a word.

On x86_64 with TABLES_NEXT_TO_CODE (except on MachO, due to #15169):

- info-&gt;srt is zero if there's no SRT, otherwise:
- info-&gt;srt is an offset from the info pointer to the SRT object

StgStdInfoTable       +------+
  info-&gt;layout.ptrs   |      |
  info-&gt;layout.nptrs  |      |
  info-&gt;srt           |  ------------&gt; offset to SRT object
                      |------|


EXAMPLE
^^^^^^^

f = \x. ... g ...
  where
    g = \y. ... h ... c1 ...
    h = \z. ... c2 ...

c1 &amp; c2 are CAFs

g and h are local functions, but they have no static closures.  When
we generate code for f, we start with a CmmGroup of four CmmDecls:

   [ f_closure, f_entry, g_entry, h_entry ]

we process each CmmDecl separately in cpsTop, giving us a list of
CmmDecls. e.g. for f_entry, we might end up with

   [ f_entry, f1_ret, f2_proc ]

where f1_ret is a return point, and f2_proc is a proc-point.  We have
a CAFSet for each of these CmmDecls, let's suppose they are

   [ f_entry{g_info}, f1_ret{g_info}, f2_proc{} ]
   [ g_entry{h_info, c1_closure} ]
   [ h_entry{c2_closure} ]

Next, we make an SRT for each of these functions:

  f_srt : [g_info]
  g_srt : [h_info, c1_closure]
  h_srt : [c2_closure]

Now, for g_info and h_info, we want to refer to the SRTs for g and h
respectively, which we'll label g_srt and h_srt:

  f_srt : [g_srt]
  g_srt : [h_srt, c1_closure]
  h_srt : [c2_closure]

Now, when an SRT has a single entry, we don't actually generate an SRT
closure for it, instead we just replace references to it with its
single element.  So, since h_srt == c2_closure, we have

  f_srt : [g_srt]
  g_srt : [c2_closure, c1_closure]
  h_srt : [c2_closure]

and the only SRT closure we generate is

  g_srt = SRT_2 [c2_closure, c1_closure]

Algorithm
^^^^^^^^^

0. let srtMap :: Map CAFLabel (Maybe SRTEntry) = {}
   Maps closures to their SRT entries (i.e. how they appear in a SRT payload)

1. Start with decls :: [CmmDecl]. This corresponds to an SCC of bindings in STG
   after code-generation.

2. CPS-convert each CmmDecl (cpsTop), resulting in a list [CmmDecl]. There might
   be multiple CmmDecls in the result, due to proc-point splitting.

3. In cpsTop, *before* proc-point splitting, when we still have a single
   CmmDecl, we do cafAnal for procs:

   * cafAnal performs a backwards analysis on the code blocks

   * For each labelled block, the analysis produces a CAFSet (= Set CAFLabel),
     representing all the CAFLabels reachable from this label.

   * A label is added to the set if it refers to a FUN, THUNK, or RET,
     and its CafInfo /= NoCafRefs.
     (NB. all CafInfo for Ids in the current module should be initialised to
     MayHaveCafRefs)

   * The result is CAFEnv = LabelMap CAFSet

   (Why *before* proc-point splitting? Because the analysis needs to propagate
   information across branches, and proc-point splitting turns branches into
   CmmCalls to top-level CmmDecls.  The analysis would fail to find all the
   references to CAFFY labels if we did it after proc-point splitting.)

   For static data, cafAnalData simply returns set of all labels that refer to a
   FUN, THUNK, and RET whose CafInfos /= NoCafRefs.

4. The result of cpsTop is (CAFEnv, [CmmDecl]) for procs and (CAFSet, CmmDecl)
   for static data. So after `mapM cpsTop decls` we have
   [Either (CAFEnv, [CmmDecl]) (CAFSet, CmmDecl)]

5. For procs concat the decls and union the CAFEnvs to get (CAFEnv, [CmmDecl])

6. For static data generate a Map CLabel CAFSet (maps static data to their CAFSets)

7. Dependency-analyse the decls using CAFEnv and CAFSets, giving us SCC CAFLabel

8. For each SCC in dependency order
   - Let lbls :: [CAFLabel] be the non-recursive labels in this SCC
   - Apply CAFEnv to each label and concat the result :: [CAFLabel]
   - For each CAFLabel in the set apply srtMap (and ignore Nothing) to get
     srt :: [SRTEntry]
   - Make a label for this SRT, call it l
   - If the SRT is not empty (i.e. the group is CAFFY) add FUN_STATICs in the
     group to the SRT (see Note [Invalid optimisation: shortcutting])
   - Add to srtMap: lbls -&gt; if null srt then Nothing else Just l

9. At the end, for every top-level binding x, if srtMap x == Nothing, then the
   binding is non-CAFFY, otherwise it is CAFFY.

Optimisations
^^^^^^^^^^^^^

To reduce the code size overhead and the cost of traversing SRTs in
the GC, we want to simplify SRTs where possible. We therefore apply
the following optimisations.  Each has a [keyword]; search for the
keyword in the code below to see where the optimisation is
implemented.

1. [Inline] we never create an SRT with a single entry, instead we
   point to the single entry directly from the info table.

   i.e. instead of

    +------+
    | info |
    |      |     +-----+---+---+
    |   --------&gt;|SRT_1| | | 0 |
    |------|     +-----+-|-+---+
    |      |             |
    | code |             |
    |      |             v
                         C

   we can point directly to the closure:

    +------+
    | info |
    |      |
    |   --------&gt;C
    |------|
    |      |
    | code |
    |      |


   Furthermore, the SRT for any code that refers to this info table
   can point directly to C.

   The exception to this is when we're doing dynamic linking. In that
   case, if the closure is not locally defined then we can't point to
   it directly from the info table, because this is the text section
   which cannot contain runtime relocations. In this case we skip this
   optimisation and generate the singleton SRT, because SRTs are in the
   data section and *can* have relocatable references.

2. [FUN] A static function closure can also be an SRT, we simply put
   the SRT entries as fields in the static closure.  This makes a lot
   of sense: the static references are just like the free variables of
   the FUN closure.

   i.e. instead of

   f_closure:
   +-----+---+
   |  |  | 0 |
   +- |--+---+
      |            +------+
      |            | info |     f_srt:
      |            |      |     +-----+---+---+---+
      |            |   --------&gt;|SRT_2| | | | + 0 |
      `-----------&gt;|------|     +-----+-|-+-|-+---+
                   |      |             |   |
                   | code |             |   |
                   |      |             v   v


   We can generate:

   f_closure:
   +-----+---+---+---+
   |  |  | | | | | 0 |
   +- |--+-|-+-|-+---+
      |    |   |   +------+
      |    v   v   | info |
      |            |      |
      |            |   0  |
      `-----------&gt;|------|
                   |      |
                   | code |
                   |      |


   (note: we can't do this for THUNKs, because the thunk gets
   overwritten when it is entered, so we wouldn't be able to share
   this SRT with other info tables that want to refer to it (see
   [Common] below). FUNs are immutable so don't have this problem.)

3. [Common] Identical SRTs can be commoned up.

4. [Filter] If an SRT A refers to an SRT B and a closure C, and B also
   refers to C (perhaps transitively), then we can omit the reference
   to C from A.


Note that there are many other optimisations that we could do, but
aren't implemented. In general, we could omit any reference from an
SRT if everything reachable from it is also reachable from the other
fields in the SRT. Our [Filter] optimisation is a special case of
this.

Another opportunity we don't exploit is this:

A = {X,Y,Z}
B = {Y,Z}
C = {X,B}

Here we could use C = {A} and therefore [Inline] C = A.
-}</span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-comment">-- ---------------------------------------------------------------------</span><span>
</span><span id="line-361"></span><span class="hs-comment">{- Note [Invalid optimisation: shortcutting]

You might think that if we have something like

A's SRT = {B}
B's SRT = {X}

that we could replace the reference to B in A's SRT with X.

A's SRT = {X}
B's SRT = {X}

and thereby perhaps save a little work at runtime, because we don't
have to visit B.

But this is NOT valid.

Consider these cases:

0. B can't be a constructor, because constructors don't have SRTs

1. B is a CAF. This is the easy one. Obviously we want A's SRT to
   point to B, so that it keeps B alive.

2. B is a function.  This is the tricky one. The reason we can't
shortcut in this case is that we aren't allowed to resurrect static
objects.

== How does this cause a problem? ==

The particular case that cropped up when we tried this was #15544.
- A is a thunk
- B is a static function
- X is a CAF
- suppose we GC when A is alive, and B is not otherwise reachable.
- B is &quot;collected&quot;, meaning that it doesn't make it onto the static
  objects list during this GC, but nothing bad happens yet.
- Next, suppose we enter A, and then call B. (remember that A refers to B)
  At the entry point to B, we GC. This puts B on the stack, as part of the
  RET_FUN stack frame that gets pushed when we GC at a function entry point.
- This GC will now reach B
- But because B was previous &quot;collected&quot;, it breaks the assumption
  that static objects are never resurrected. See Note [STATIC_LINK
  fields] in rts/sm/Storage.h for why this is bad.
- In practice, the GC thinks that B has already been visited, and so
  doesn't visit X, and catastrophe ensues.

== Isn't this caused by the RET_FUN business? ==

Maybe, but could you prove that RET_FUN is the only way that
resurrection can occur?

So, no shortcutting.

Note [Ticky labels in SRT analysis]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Raw Cmm data (CmmStaticsRaw) can't contain pointers so they're considered
non-CAFFY in SRT analysis and we update the SRTMap mapping them to `Nothing`
(meaning they're not CAFFY).

However when building with -ticky we generate ticky CLabels using the function's
`Name`. For example, if we have a top-level function `sat_s1rQ`, in a ticky
build we get two IdLabels using the name `sat_s1rQ`:

- For the function itself: IdLabel sat_s1rQ ... Entry
- For the ticky counter: IdLabel sat_s1rQ ... RednCounts

In these cases we really want to use the function definition for the SRT
analysis of this Name, because that's what we export for this Name -- ticky
counters are not exported. So we ignore ticky counters in SRT analysis (which
are never CAFFY and never exported).

Not doing this caused #17947 where we analysed the function first mapped the
name to CAFFY. We then saw the ticky constructor, and becuase it has the same
Name as the function and is not CAFFY we overrode the CafInfo of the name as
non-CAFFY.
-}</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="hs-comment">-- ---------------------------------------------------------------------</span><span>
</span><span id="line-441"></span><span class="hs-comment">-- Label types</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="hs-comment">-- Labels that come from cafAnal can be:</span><span>
</span><span id="line-444"></span><span class="hs-comment">--   - _closure labels for static functions or CAFs</span><span>
</span><span id="line-445"></span><span class="hs-comment">--   - _info labels for dynamic functions, thunks, or continuations</span><span>
</span><span id="line-446"></span><span class="hs-comment">--   - _entry labels for functions or thunks</span><span>
</span><span id="line-447"></span><span class="hs-comment">--</span><span>
</span><span id="line-448"></span><span class="hs-comment">-- Meanwhile the labels on top-level blocks are _entry labels.</span><span>
</span><span id="line-449"></span><span class="hs-comment">--</span><span>
</span><span id="line-450"></span><span class="hs-comment">-- To put everything in the same namespace we convert all labels to</span><span>
</span><span id="line-451"></span><span class="hs-comment">-- closure labels using toClosureLbl.  Note that some of these</span><span>
</span><span id="line-452"></span><span class="hs-comment">-- labels will not actually exist; that's ok because we're going to</span><span>
</span><span id="line-453"></span><span class="hs-comment">-- map them to SRTEntry later, which ranges over labels that do exist.</span><span>
</span><span id="line-454"></span><span class="hs-comment">--</span><span>
</span><span id="line-455"></span><span class="hs-keyword">newtype</span><span> </span><span id="CAFLabel"><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-var">CAFLabel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="CAFLabel"><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-var">CAFLabel</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-456"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681056296"><span id="local-6989586621681056301"><span class="annot"><span class="annottext">CAFLabel -&gt; CAFLabel -&gt; Bool
(CAFLabel -&gt; CAFLabel -&gt; Bool)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; Bool) -&gt; Eq CAFLabel
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: CAFLabel -&gt; CAFLabel -&gt; Bool
$c/= :: CAFLabel -&gt; CAFLabel -&gt; Bool
== :: CAFLabel -&gt; CAFLabel -&gt; Bool
$c== :: CAFLabel -&gt; CAFLabel -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span id="local-6989586621681056264"><span id="local-6989586621681056268"><span id="local-6989586621681056272"><span id="local-6989586621681056276"><span id="local-6989586621681056280"><span id="local-6989586621681056284"><span id="local-6989586621681056288"><span class="annot"><span class="annottext">Eq CAFLabel
Eq CAFLabel
-&gt; (CAFLabel -&gt; CAFLabel -&gt; Ordering)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; Bool)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; Bool)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; Bool)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; Bool)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; CAFLabel)
-&gt; (CAFLabel -&gt; CAFLabel -&gt; CAFLabel)
-&gt; Ord CAFLabel
CAFLabel -&gt; CAFLabel -&gt; Bool
CAFLabel -&gt; CAFLabel -&gt; Ordering
CAFLabel -&gt; CAFLabel -&gt; CAFLabel
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: CAFLabel -&gt; CAFLabel -&gt; CAFLabel
$cmin :: CAFLabel -&gt; CAFLabel -&gt; CAFLabel
max :: CAFLabel -&gt; CAFLabel -&gt; CAFLabel
$cmax :: CAFLabel -&gt; CAFLabel -&gt; CAFLabel
&gt;= :: CAFLabel -&gt; CAFLabel -&gt; Bool
$c&gt;= :: CAFLabel -&gt; CAFLabel -&gt; Bool
&gt; :: CAFLabel -&gt; CAFLabel -&gt; Bool
$c&gt; :: CAFLabel -&gt; CAFLabel -&gt; Bool
&lt;= :: CAFLabel -&gt; CAFLabel -&gt; Bool
$c&lt;= :: CAFLabel -&gt; CAFLabel -&gt; Bool
&lt; :: CAFLabel -&gt; CAFLabel -&gt; Bool
$c&lt; :: CAFLabel -&gt; CAFLabel -&gt; Bool
compare :: CAFLabel -&gt; CAFLabel -&gt; Ordering
$ccompare :: CAFLabel -&gt; CAFLabel -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span id="local-6989586621681056255"><span id="local-6989586621681056259"><span class="annot"><span class="annottext">Rational -&gt; CAFLabel -&gt; SDoc
CAFLabel -&gt; SDoc
(CAFLabel -&gt; SDoc)
-&gt; (Rational -&gt; CAFLabel -&gt; SDoc) -&gt; Outputable CAFLabel
forall a. (a -&gt; SDoc) -&gt; (Rational -&gt; a -&gt; SDoc) -&gt; Outputable a
pprPrec :: Rational -&gt; CAFLabel -&gt; SDoc
$cpprPrec :: Rational -&gt; CAFLabel -&gt; SDoc
ppr :: CAFLabel -&gt; SDoc
$cppr :: CAFLabel -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#C%3AOutputable"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Outputable</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span class="hs-keyword">type</span><span> </span><span id="CAFSet"><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-var">CAFSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span>
</span><span id="line-459"></span><span class="hs-keyword">type</span><span> </span><span id="CAFEnv"><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFEnv"><span class="hs-identifier hs-var">CAFEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-460"></span><span>
</span><span id="line-461"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-type">mkCAFLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span>
</span><span id="line-462"></span><span id="mkCAFLabel"><span class="annot"><span class="annottext">mkCAFLabel :: CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var hs-var">mkCAFLabel</span></a></span></span><span> </span><span id="local-6989586621681056250"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056250"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-var">CAFLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#toClosureLbl"><span class="hs-identifier hs-var">toClosureLbl</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056250"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span>
</span><span id="line-464"></span><span class="hs-comment">-- This is a label that we can put in an SRT.  It *must* be a closure label,</span><span>
</span><span id="line-465"></span><span class="hs-comment">-- pointing to either a FUN_STATIC, THUNK_STATIC, or CONSTR.</span><span>
</span><span id="line-466"></span><span class="hs-keyword">newtype</span><span> </span><span id="SRTEntry"><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-var">SRTEntry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="SRTEntry"><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-var">SRTEntry</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-467"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681056242"><span id="local-6989586621681056246"><span class="annot"><span class="annottext">SRTEntry -&gt; SRTEntry -&gt; Bool
(SRTEntry -&gt; SRTEntry -&gt; Bool)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; Bool) -&gt; Eq SRTEntry
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: SRTEntry -&gt; SRTEntry -&gt; Bool
$c/= :: SRTEntry -&gt; SRTEntry -&gt; Bool
== :: SRTEntry -&gt; SRTEntry -&gt; Bool
$c== :: SRTEntry -&gt; SRTEntry -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681056211"><span id="local-6989586621681056215"><span id="local-6989586621681056219"><span id="local-6989586621681056223"><span id="local-6989586621681056227"><span id="local-6989586621681056231"><span id="local-6989586621681056235"><span class="annot"><span class="annottext">Eq SRTEntry
Eq SRTEntry
-&gt; (SRTEntry -&gt; SRTEntry -&gt; Ordering)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; Bool)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; Bool)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; Bool)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; Bool)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; SRTEntry)
-&gt; (SRTEntry -&gt; SRTEntry -&gt; SRTEntry)
-&gt; Ord SRTEntry
SRTEntry -&gt; SRTEntry -&gt; Bool
SRTEntry -&gt; SRTEntry -&gt; Ordering
SRTEntry -&gt; SRTEntry -&gt; SRTEntry
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: SRTEntry -&gt; SRTEntry -&gt; SRTEntry
$cmin :: SRTEntry -&gt; SRTEntry -&gt; SRTEntry
max :: SRTEntry -&gt; SRTEntry -&gt; SRTEntry
$cmax :: SRTEntry -&gt; SRTEntry -&gt; SRTEntry
&gt;= :: SRTEntry -&gt; SRTEntry -&gt; Bool
$c&gt;= :: SRTEntry -&gt; SRTEntry -&gt; Bool
&gt; :: SRTEntry -&gt; SRTEntry -&gt; Bool
$c&gt; :: SRTEntry -&gt; SRTEntry -&gt; Bool
&lt;= :: SRTEntry -&gt; SRTEntry -&gt; Bool
$c&lt;= :: SRTEntry -&gt; SRTEntry -&gt; Bool
&lt; :: SRTEntry -&gt; SRTEntry -&gt; Bool
$c&lt; :: SRTEntry -&gt; SRTEntry -&gt; Bool
compare :: SRTEntry -&gt; SRTEntry -&gt; Ordering
$ccompare :: SRTEntry -&gt; SRTEntry -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681056203"><span id="local-6989586621681056207"><span class="annot"><span class="annottext">Rational -&gt; SRTEntry -&gt; SDoc
SRTEntry -&gt; SDoc
(SRTEntry -&gt; SDoc)
-&gt; (Rational -&gt; SRTEntry -&gt; SDoc) -&gt; Outputable SRTEntry
forall a. (a -&gt; SDoc) -&gt; (Rational -&gt; a -&gt; SDoc) -&gt; Outputable a
pprPrec :: Rational -&gt; SRTEntry -&gt; SDoc
$cpprPrec :: Rational -&gt; SRTEntry -&gt; SDoc
ppr :: SRTEntry -&gt; SDoc
$cppr :: SRTEntry -&gt; SDoc
</span><a href="#local-6989586621681056203"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Outputable</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span class="hs-comment">-- ---------------------------------------------------------------------</span><span>
</span><span id="line-470"></span><span class="hs-comment">-- CAF analysis</span><span>
</span><span id="line-471"></span><span>
</span><span id="line-472"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-type">addCafLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-473"></span><span id="addCafLabel"><span class="annot"><span class="annottext">addCafLabel :: CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var hs-var">addCafLabel</span></a></span></span><span> </span><span id="local-6989586621681056199"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056199"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681056198"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056198"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-474"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Maybe Name
</span><a href="GHC.Cmm.CLabel.html#hasHaskellName"><span class="hs-identifier hs-var">hasHaskellName</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056199"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-475"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681056196"><span class="annot"><span class="annottext">caf_label :: CAFLabel
</span><a href="#local-6989586621681056196"><span class="hs-identifier hs-var hs-var">caf_label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var">mkCAFLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056199"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-476"></span><span>    </span><span class="hs-comment">-- For imported Ids hasCAF will have accurate CafInfo</span><span>
</span><span id="line-477"></span><span>    </span><span class="hs-comment">-- Locals are initialized as CAFFY. We turn labels with empty SRTs into</span><span>
</span><span id="line-478"></span><span>    </span><span class="hs-comment">-- non-CAFFYs in doSRTs</span><span>
</span><span id="line-479"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#hasCAF"><span class="hs-identifier hs-var">hasCAF</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056199"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-480"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CAFLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
forall a. Ord a =&gt; a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#insert"><span class="hs-identifier hs-var">Set.insert</span></a></span><span> </span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681056196"><span class="hs-identifier hs-var">caf_label</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056198"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-481"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-482"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056198"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-483"></span><span>
</span><span id="line-484"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafAnalData"><span class="hs-identifier hs-type">cafAnalData</span></a></span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-type">CmmStatics</span></a></span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span id="cafAnalData"><span class="annot"><span class="annottext">cafAnalData :: GenCmmStatics 'False -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#cafAnalData"><span class="hs-identifier hs-var hs-var">cafAnalData</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681056191"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056191"><span class="hs-identifier hs-var">_lbl</span></a></span></span><span> </span><span id="local-6989586621681056190"><span class="annot"><span class="annottext">[CmmStatic]
</span><a href="#local-6989586621681056190"><span class="hs-identifier hs-var">_data</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-489"></span><span>    </span><span class="annot"><span class="annottext">Set CAFLabel
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">Set.empty</span></a></span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafAnalData"><span class="hs-identifier hs-var">cafAnalData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-type">CmmStatics</span></a></span><span> </span><span id="local-6989586621681056185"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056185"><span class="hs-identifier hs-var">_lbl</span></a></span></span><span> </span><span id="local-6989586621681056184"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681056184"><span class="hs-identifier hs-var">_itbl</span></a></span></span><span> </span><span id="local-6989586621681056183"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681056183"><span class="hs-identifier hs-var">_ccs</span></a></span></span><span> </span><span id="local-6989586621681056182"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681056182"><span class="hs-identifier hs-var">payload</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-492"></span><span>    </span><span class="annot"><span class="annottext">(Set CAFLabel -&gt; CmmLit -&gt; Set CAFLabel)
-&gt; Set CAFLabel -&gt; [CmmLit] -&gt; Set CAFLabel
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; CmmLit -&gt; Set CAFLabel
</span><a href="#local-6989586621681056180"><span class="hs-identifier hs-var">analyzeStatic</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">Set.empty</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681056182"><span class="hs-identifier hs-var">payload</span></a></span><span>
</span><span id="line-493"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-494"></span><span>    </span><span id="local-6989586621681056180"><span class="annot"><span class="annottext">analyzeStatic :: Set CAFLabel -&gt; CmmLit -&gt; Set CAFLabel
</span><a href="#local-6989586621681056180"><span class="hs-identifier hs-var hs-var">analyzeStatic</span></a></span></span><span> </span><span id="local-6989586621681056179"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056179"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621681056178"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681056178"><span class="hs-identifier hs-var">lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-495"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681056178"><span class="hs-identifier hs-var">lit</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-496"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-type">CmmLabel</span></a></span><span> </span><span id="local-6989586621681056176"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056176"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056176"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056179"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-497"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelOff"><span class="hs-identifier hs-type">CmmLabelOff</span></a></span><span> </span><span id="local-6989586621681056174"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056174"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056174"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056179"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-498"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelDiffOff"><span class="hs-identifier hs-type">CmmLabelDiffOff</span></a></span><span> </span><span id="local-6989586621681056172"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056172"><span class="hs-identifier hs-var">c1</span></a></span></span><span> </span><span id="local-6989586621681056171"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056171"><span class="hs-identifier hs-var">c2</span></a></span></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056172"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">(Set CAFLabel -&gt; Set CAFLabel) -&gt; Set CAFLabel -&gt; Set CAFLabel
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056171"><span class="hs-identifier hs-var">c2</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056179"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-499"></span><span>        </span><span class="annot"><span class="annottext">CmmLit
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056179"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-502"></span><span class="hs-comment">-- For each code block:</span><span>
</span><span id="line-503"></span><span class="hs-comment">--   - collect the references reachable from this code block to FUN,</span><span>
</span><span id="line-504"></span><span class="hs-comment">--     THUNK or RET labels for which hasCAF == True</span><span>
</span><span id="line-505"></span><span class="hs-comment">--</span><span>
</span><span id="line-506"></span><span class="hs-comment">-- This gives us a `CAFEnv`: a mapping from code block to sets of labels</span><span>
</span><span id="line-507"></span><span class="hs-comment">--</span><span>
</span><span id="line-508"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafAnal"><span class="hs-identifier hs-type">cafAnal</span></a></span><span>
</span><span id="line-509"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span>   </span><span class="hs-comment">-- The blocks representing continuations, ie. those</span><span>
</span><span id="line-510"></span><span>                </span><span class="hs-comment">-- that will get RET info tables.  These labels will</span><span>
</span><span id="line-511"></span><span>                </span><span class="hs-comment">-- get their own SRTs, so we don't aggregate CAFs from</span><span>
</span><span id="line-512"></span><span>                </span><span class="hs-comment">-- references to these labels, we just use the label.</span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>     </span><span class="hs-comment">-- The top label of the proc</span><span>
</span><span id="line-514"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-515"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFEnv"><span class="hs-identifier hs-type">CAFEnv</span></a></span><span>
</span><span id="line-516"></span><span id="cafAnal"><span class="annot"><span class="annottext">cafAnal :: LabelSet -&gt; CLabel -&gt; GenCmmGraph CmmNode -&gt; CAFEnv
</span><a href="GHC.Cmm.Info.Build.html#cafAnal"><span class="hs-identifier hs-var hs-var">cafAnal</span></a></span></span><span> </span><span id="local-6989586621681056168"><span class="annot"><span class="annottext">LabelSet
</span><a href="#local-6989586621681056168"><span class="hs-identifier hs-var">contLbls</span></a></span></span><span> </span><span id="local-6989586621681056167"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056167"><span class="hs-identifier hs-var">topLbl</span></a></span></span><span> </span><span id="local-6989586621681056166"><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681056166"><span class="hs-identifier hs-var">cmmGraph</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-517"></span><span>  </span><span class="annot"><span class="annottext">DataflowLattice (Set CAFLabel)
-&gt; TransferFun (Set CAFLabel)
-&gt; GenCmmGraph CmmNode
-&gt; CAFEnv
-&gt; CAFEnv
forall f.
DataflowLattice f
-&gt; TransferFun f -&gt; GenCmmGraph CmmNode -&gt; FactBase f -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmmBwd"><span class="hs-identifier hs-var">analyzeCmmBwd</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice (Set CAFLabel)
</span><a href="GHC.Cmm.Info.Build.html#cafLattice"><span class="hs-identifier hs-var">cafLattice</span></a></span><span>
</span><span id="line-518"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelSet -&gt; BlockId -&gt; CLabel -&gt; TransferFun (Set CAFLabel)
</span><a href="GHC.Cmm.Info.Build.html#cafTransfers"><span class="hs-identifier hs-var">cafTransfers</span></a></span><span> </span><span class="annot"><span class="annottext">LabelSet
</span><a href="#local-6989586621681056168"><span class="hs-identifier hs-var">contLbls</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681056166"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056167"><span class="hs-identifier hs-var">topLbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681056166"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span> </span><span class="annot"><span class="annottext">CAFEnv
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-519"></span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafLattice"><span class="hs-identifier hs-type">cafLattice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-522"></span><span id="cafLattice"><span class="annot"><span class="annottext">cafLattice :: DataflowLattice (Set CAFLabel)
</span><a href="GHC.Cmm.Info.Build.html#cafLattice"><span class="hs-identifier hs-var hs-var">cafLattice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
-&gt; JoinFun (Set CAFLabel) -&gt; DataflowLattice (Set CAFLabel)
forall a. a -&gt; JoinFun a -&gt; DataflowLattice a
</span><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-var">DataflowLattice</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">Set.empty</span></a></span><span> </span><span class="annot"><span class="annottext">JoinFun (Set CAFLabel)
forall {a}.
Ord a =&gt;
OldFact (Set a) -&gt; NewFact (Set a) -&gt; JoinedFact (Set a)
</span><a href="#local-6989586621681056159"><span class="hs-identifier hs-var">add</span></a></span><span>
</span><span id="line-523"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-524"></span><span>    </span><span id="local-6989586621681056159"><span class="annot"><span class="annottext">add :: OldFact (Set a) -&gt; NewFact (Set a) -&gt; JoinedFact (Set a)
</span><a href="#local-6989586621681056159"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-type">OldFact</span></a></span><span> </span><span id="local-6989586621681056153"><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056153"><span class="hs-identifier hs-var">old</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-type">NewFact</span></a></span><span> </span><span id="local-6989586621681056151"><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056151"><span class="hs-identifier hs-var">new</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-525"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681056150"><span class="annot"><span class="annottext">new' :: Set a
</span><a href="#local-6989586621681056150"><span class="hs-identifier hs-var hs-var">new'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056153"><span class="hs-identifier hs-var">old</span></a></span><span> </span><span class="annot"><span class="annottext">Set a -&gt; Set a -&gt; Set a
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#union"><span class="hs-operator hs-var">`Set.union`</span></a></span><span> </span><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056151"><span class="hs-identifier hs-var">new</span></a></span><span>
</span><span id="line-526"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Set a -&gt; JoinedFact (Set a)
forall a. Bool -&gt; a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#changedIf"><span class="hs-identifier hs-var">changedIf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set a -&gt; WordOff
forall a. Set a -&gt; WordOff
</span><a href="../../containers/src/Data.Set.Internal.html#size"><span class="hs-identifier hs-var">Set.size</span></a></span><span> </span><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056150"><span class="hs-identifier hs-var">new'</span></a></span><span> </span><span class="annot"><span class="annottext">WordOff -&gt; WordOff -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Set a -&gt; WordOff
forall a. Set a -&gt; WordOff
</span><a href="../../containers/src/Data.Set.Internal.html#size"><span class="hs-identifier hs-var">Set.size</span></a></span><span> </span><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056153"><span class="hs-identifier hs-var">old</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Set a
</span><a href="#local-6989586621681056150"><span class="hs-identifier hs-var">new'</span></a></span><span>
</span><span id="line-527"></span><span>
</span><span id="line-528"></span><span>
</span><span id="line-529"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#cafTransfers"><span class="hs-identifier hs-type">cafTransfers</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier hs-type">TransferFun</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-530"></span><span id="cafTransfers"><span class="annot"><span class="annottext">cafTransfers :: LabelSet -&gt; BlockId -&gt; CLabel -&gt; TransferFun (Set CAFLabel)
</span><a href="GHC.Cmm.Info.Build.html#cafTransfers"><span class="hs-identifier hs-var hs-var">cafTransfers</span></a></span></span><span> </span><span id="local-6989586621681056144"><span class="annot"><span class="annottext">LabelSet
</span><a href="#local-6989586621681056144"><span class="hs-identifier hs-var">contLbls</span></a></span></span><span> </span><span id="local-6989586621681056143"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056143"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span id="local-6989586621681056142"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056142"><span class="hs-identifier hs-var">topLbl</span></a></span></span><span>
</span><span id="line-531"></span><span>  </span><span id="local-6989586621681056141"><span class="annot"><span class="annottext">block :: CmmBlock
</span><a href="#local-6989586621681056141"><span class="hs-identifier hs-var">block</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BlockCC"><span class="hs-identifier hs-type">BlockCC</span></a></span><span> </span><span id="local-6989586621681056122"><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681056122"><span class="hs-identifier hs-var">eNode</span></a></span></span><span> </span><span id="local-6989586621681056121"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681056121"><span class="hs-identifier hs-var">middle</span></a></span></span><span> </span><span id="local-6989586621681056120"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681056120"><span class="hs-identifier hs-var">xNode</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681056119"><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681056119"><span class="hs-identifier hs-var">fBase</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-532"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681056118"><span class="hs-identifier hs-type">joined</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-533"></span><span>        </span><span id="local-6989586621681056118"><span class="annot"><span class="annottext">joined :: Set CAFLabel
</span><a href="#local-6989586621681056118"><span class="hs-identifier hs-var hs-var">joined</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; Set CAFLabel -&gt; Set CAFLabel
forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="#local-6989586621681056117"><span class="hs-identifier hs-var">cafsInNode</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681056120"><span class="hs-identifier hs-var">xNode</span></a></span><span> </span><span class="annot"><span class="annottext">(Set CAFLabel -&gt; Set CAFLabel) -&gt; Set CAFLabel -&gt; Set CAFLabel
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056116"><span class="hs-identifier hs-var">live'</span></a></span><span>
</span><span id="line-534"></span><span>
</span><span id="line-535"></span><span>        </span><span class="annot"><a href="#local-6989586621681056115"><span class="hs-identifier hs-type">result</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-536"></span><span>        </span><span class="hs-glyph">!</span><span id="local-6989586621681056115"><span class="annot"><span class="annottext">result :: Set CAFLabel
</span><a href="#local-6989586621681056115"><span class="hs-identifier hs-var hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmNode O O -&gt; Set CAFLabel -&gt; Set CAFLabel)
-&gt; Block CmmNode O O -&gt; Set CAFLabel -&gt; Set CAFLabel
forall f. (CmmNode O O -&gt; f -&gt; f) -&gt; Block CmmNode O O -&gt; f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#foldNodesBwdOO"><span class="hs-identifier hs-var">foldNodesBwdOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; Set CAFLabel -&gt; Set CAFLabel
forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="#local-6989586621681056117"><span class="hs-identifier hs-var">cafsInNode</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681056121"><span class="hs-identifier hs-var">middle</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056118"><span class="hs-identifier hs-var">joined</span></a></span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span>        </span><span class="annot"><a href="#local-6989586621681056113"><span class="hs-identifier hs-type">facts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-539"></span><span>        </span><span id="local-6989586621681056113"><span class="annot"><span class="annottext">facts :: [Set CAFLabel]
</span><a href="#local-6989586621681056113"><span class="hs-identifier hs-var hs-var">facts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; Maybe (Set CAFLabel)) -&gt; [BlockId] -&gt; [Set CAFLabel]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Maybe (Set CAFLabel)
</span><a href="#local-6989586621681056111"><span class="hs-identifier hs-var">successorFact</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O C -&gt; [BlockId]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [BlockId]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681056120"><span class="hs-identifier hs-var">xNode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>
</span><span id="line-541"></span><span>        </span><span class="annot"><a href="#local-6989586621681056116"><span class="hs-identifier hs-type">live'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-542"></span><span>        </span><span id="local-6989586621681056116"><span class="annot"><span class="annottext">live' :: Set CAFLabel
</span><a href="#local-6989586621681056116"><span class="hs-identifier hs-var hs-var">live'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataflowLattice (Set CAFLabel) -&gt; [Set CAFLabel] -&gt; Set CAFLabel
forall f. DataflowLattice f -&gt; [f] -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#joinFacts"><span class="hs-identifier hs-var">joinFacts</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice (Set CAFLabel)
</span><a href="GHC.Cmm.Info.Build.html#cafLattice"><span class="hs-identifier hs-var">cafLattice</span></a></span><span> </span><span class="annot"><span class="annottext">[Set CAFLabel]
</span><a href="#local-6989586621681056113"><span class="hs-identifier hs-var">facts</span></a></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span>        </span><span class="annot"><a href="#local-6989586621681056111"><span class="hs-identifier hs-type">successorFact</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-545"></span><span>        </span><span id="local-6989586621681056111"><span class="annot"><span class="annottext">successorFact :: BlockId -&gt; Maybe (Set CAFLabel)
</span><a href="#local-6989586621681056111"><span class="hs-identifier hs-var hs-var">successorFact</span></a></span></span><span> </span><span id="local-6989586621681056108"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056108"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-546"></span><span>          </span><span class="hs-comment">-- If this is a loop back to the entry, we can refer to the</span><span>
</span><span id="line-547"></span><span>          </span><span class="hs-comment">-- entry label.</span><span>
</span><span id="line-548"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056108"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056143"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; Maybe (Set CAFLabel)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056142"><span class="hs-identifier hs-var">topLbl</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">Set.empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-549"></span><span>          </span><span class="hs-comment">-- If this is a continuation, we want to refer to the</span><span>
</span><span id="line-550"></span><span>          </span><span class="hs-comment">-- SRT for the continuation's info table</span><span>
</span><span id="line-551"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ElemOf LabelSet
BlockId
</span><a href="#local-6989586621681056108"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf LabelSet -&gt; LabelSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-operator hs-var">`setMember`</span></a></span><span> </span><span class="annot"><span class="annottext">LabelSet
</span><a href="#local-6989586621681056144"><span class="hs-identifier hs-var">contLbls</span></a></span><span>
</span><span id="line-552"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; Maybe (Set CAFLabel)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CAFLabel -&gt; Set CAFLabel
forall a. a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#singleton"><span class="hs-identifier hs-var">Set.singleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var">mkCAFLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CLabel
</span><a href="GHC.Cmm.BlockId.html#infoTblLbl"><span class="hs-identifier hs-var">infoTblLbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056108"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-553"></span><span>          </span><span class="hs-comment">-- Otherwise, takes the CAF references from the destination</span><span>
</span><span id="line-554"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-555"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CAFEnv -&gt; Maybe (Set CAFLabel)
forall f. BlockId -&gt; FactBase f -&gt; Maybe f
</span><a href="GHC.Cmm.Dataflow.Label.html#lookupFact"><span class="hs-identifier hs-var">lookupFact</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056108"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681056119"><span class="hs-identifier hs-var">fBase</span></a></span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span>        </span><span id="local-6989586621681056680"><span id="local-6989586621681056681"><span class="annot"><a href="#local-6989586621681056117"><span class="hs-identifier hs-type">cafsInNode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681056681"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681056680"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span></span></span><span>
</span><span id="line-558"></span><span>        </span><span id="local-6989586621681056117"><span class="annot"><span class="annottext">cafsInNode :: forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="#local-6989586621681056117"><span class="hs-identifier hs-var hs-var">cafsInNode</span></a></span></span><span> </span><span id="local-6989586621681056103"><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681056103"><span class="hs-identifier hs-var">node</span></a></span></span><span> </span><span id="local-6989586621681056102"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056102"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; Set CAFLabel -&gt; Set CAFLabel)
-&gt; CmmNode e x -&gt; Set CAFLabel -&gt; Set CAFLabel
forall z (e :: Extensibility) (x :: Extensibility).
(CmmExpr -&gt; z -&gt; z) -&gt; CmmNode e x -&gt; z -&gt; z
</span><a href="GHC.Cmm.Node.html#foldExpDeep"><span class="hs-identifier hs-var">foldExpDeep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="#local-6989586621681056100"><span class="hs-identifier hs-var">addCafExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681056103"><span class="hs-identifier hs-var">node</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056102"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-559"></span><span>
</span><span id="line-560"></span><span>        </span><span class="annot"><a href="#local-6989586621681056100"><span class="hs-identifier hs-type">addCafExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span>
</span><span id="line-561"></span><span>        </span><span id="local-6989586621681056100"><span class="annot"><span class="annottext">addCafExpr :: CmmExpr -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="#local-6989586621681056100"><span class="hs-identifier hs-var hs-var">addCafExpr</span></a></span></span><span> </span><span id="local-6989586621681056099"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681056099"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681056098"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056098"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-562"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681056099"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-563"></span><span>            </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-type">CmmLabel</span></a></span><span> </span><span id="local-6989586621681056096"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056096"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-564"></span><span>              </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056096"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056098"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-565"></span><span>            </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelOff"><span class="hs-identifier hs-type">CmmLabelOff</span></a></span><span> </span><span id="local-6989586621681056095"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056095"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-566"></span><span>              </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056095"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056098"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-567"></span><span>            </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelDiffOff"><span class="hs-identifier hs-type">CmmLabelDiffOff</span></a></span><span> </span><span id="local-6989586621681056094"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056094"><span class="hs-identifier hs-var">c1</span></a></span></span><span> </span><span id="local-6989586621681056093"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056093"><span class="hs-identifier hs-var">c2</span></a></span></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-568"></span><span>              </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056094"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">(Set CAFLabel -&gt; Set CAFLabel) -&gt; Set CAFLabel -&gt; Set CAFLabel
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#addCafLabel"><span class="hs-identifier hs-var">addCafLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056093"><span class="hs-identifier hs-var">c2</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056098"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-569"></span><span>            </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-570"></span><span>              </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056098"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-571"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-572"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; CAFEnv -&gt; CAFEnv
forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var">srtTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cafTransfers&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;block:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681056141"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-573"></span><span>                                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;contLbls:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">LabelSet -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LabelSet
</span><a href="#local-6989586621681056144"><span class="hs-identifier hs-var">contLbls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-574"></span><span>                                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;entry:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056143"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-575"></span><span>                                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;topLbl:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056142"><span class="hs-identifier hs-var">topLbl</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-576"></span><span>                                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cafs in exit:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056118"><span class="hs-identifier hs-var">joined</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-577"></span><span>                                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;result:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056115"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CAFEnv -&gt; CAFEnv) -&gt; CAFEnv -&gt; CAFEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-578"></span><span>        </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; Set CAFLabel -&gt; CAFEnv
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSingleton"><span class="hs-identifier hs-var">mapSingleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681056122"><span class="hs-identifier hs-var">eNode</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681056115"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-579"></span><span>
</span><span id="line-580"></span><span>
</span><span id="line-581"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-582"></span><span class="hs-comment">-- ModuleSRTInfo</span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span class="hs-keyword">data</span><span> </span><span id="ModuleSRTInfo"><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-var">ModuleSRTInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ModuleSRTInfo"><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-var">ModuleSRTInfo</span></a></span></span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="thisModule"><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Module
</span><a href="GHC.Cmm.Info.Build.html#thisModule"><span class="hs-identifier hs-var hs-var">thisModule</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-586"></span><span>    </span><span class="hs-comment">-- ^ Current module being compiled. Required for calling labelDynamic.</span><span>
</span><span id="line-587"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="dedupSRTs"><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Map (Set SRTEntry) SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#dedupSRTs"><span class="hs-identifier hs-var hs-var">dedupSRTs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span>
</span><span id="line-588"></span><span>    </span><span class="hs-comment">-- ^ previous SRTs we've emitted, so we can de-duplicate.</span><span>
</span><span id="line-589"></span><span>    </span><span class="hs-comment">-- Used to implement the [Common] optimisation.</span><span>
</span><span id="line-590"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="flatSRTs"><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Map SRTEntry (Set SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#flatSRTs"><span class="hs-identifier hs-var hs-var">flatSRTs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-591"></span><span>    </span><span class="hs-comment">-- ^ The reverse mapping, so that we can remove redundant</span><span>
</span><span id="line-592"></span><span>    </span><span class="hs-comment">-- entries. e.g.  if we have an SRT [a,b,c], and we know that b</span><span>
</span><span id="line-593"></span><span>    </span><span class="hs-comment">-- points to [c,d], we can omit c and emit [a,b].</span><span>
</span><span id="line-594"></span><span>    </span><span class="hs-comment">-- Used to implement the [Filter] optimisation.</span><span>
</span><span id="line-595"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="moduleSRTMap"><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var hs-var">moduleSRTMap</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTMap"><span class="hs-identifier hs-type">SRTMap</span></a></span><span>
</span><span id="line-596"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-597"></span><span>
</span><span id="line-598"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681056078"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-599"></span><span>  </span><span id="local-6989586621681056074"><span class="annot"><span class="annottext">ppr :: ModuleSRTInfo -&gt; SDoc
</span><a href="#local-6989586621681056074"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span class="hs-special">{</span><span id="local-6989586621681056070"><span id="local-6989586621681056071"><span id="local-6989586621681056072"><span id="local-6989586621681056073"><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry
SRTMap
Map SRTEntry (Set SRTEntry)
Module
moduleSRTMap :: SRTMap
flatSRTs :: Map SRTEntry (Set SRTEntry)
dedupSRTs :: Map (Set SRTEntry) SRTEntry
thisModule :: Module
moduleSRTMap :: ModuleSRTInfo -&gt; SRTMap
flatSRTs :: ModuleSRTInfo -&gt; Map SRTEntry (Set SRTEntry)
dedupSRTs :: ModuleSRTInfo -&gt; Map (Set SRTEntry) SRTEntry
thisModule :: ModuleSRTInfo -&gt; Module
</span><a href="#local-6989586621681056070"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-600"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ModuleSRTInfo {&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-601"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WordOff -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dedupSRTs =&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry
</span><a href="#local-6989586621681056072"><span class="hs-identifier hs-var">dedupSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-602"></span><span>                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;flatSRTs =&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Map SRTEntry (Set SRTEntry) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Map SRTEntry (Set SRTEntry)
</span><a href="#local-6989586621681056071"><span class="hs-identifier hs-var">flatSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-603"></span><span>                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;moduleSRTMap =&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681056070"><span class="hs-identifier hs-var">moduleSRTMap</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'}'</span></span><span>
</span><span id="line-604"></span><span>
</span><span id="line-605"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#emptySRT"><span class="hs-identifier hs-type">emptySRT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span>
</span><span id="line-606"></span><span id="emptySRT"><span class="annot"><span class="annottext">emptySRT :: Module -&gt; ModuleSRTInfo
</span><a href="GHC.Cmm.Info.Build.html#emptySRT"><span class="hs-identifier hs-var hs-var">emptySRT</span></a></span></span><span> </span><span id="local-6989586621681056067"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681056067"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-607"></span><span>  </span><span class="annot"><span class="annottext">ModuleSRTInfo :: Module
-&gt; Map (Set SRTEntry) SRTEntry
-&gt; Map SRTEntry (Set SRTEntry)
-&gt; SRTMap
-&gt; ModuleSRTInfo
</span><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span>
</span><span id="line-608"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">thisModule :: Module
</span><a href="GHC.Cmm.Info.Build.html#thisModule"><span class="hs-identifier hs-var">thisModule</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681056067"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-609"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">dedupSRTs :: Map (Set SRTEntry) SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#dedupSRTs"><span class="hs-identifier hs-var">dedupSRTs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span>
</span><span id="line-610"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">flatSRTs :: Map SRTEntry (Set SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#flatSRTs"><span class="hs-identifier hs-var">flatSRTs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map SRTEntry (Set SRTEntry)
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span>
</span><span id="line-611"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">moduleSRTMap :: SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var">moduleSRTMap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SRTMap
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span>
</span><span id="line-612"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-613"></span><span>
</span><span id="line-614"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-615"></span><span class="hs-comment">-- Constructing SRTs</span><span>
</span><span id="line-616"></span><span>
</span><span id="line-617"></span><span class="hs-comment">{- Implementation notes

- In each CmmDecl there is a mapping info_tbls from Label -&gt; CmmInfoTable

- The entry in info_tbls corresponding to g_entry is the closure info
  table, the rest are continuations.

- Each entry in info_tbls possibly needs an SRT.  We need to make a
  label for each of these.

- We get the CAFSet for each entry from the CAFEnv

-}</span><span>
</span><span id="line-630"></span><span>
</span><span id="line-631"></span><span class="hs-keyword">data</span><span> </span><span id="SomeLabel"><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-var">SomeLabel</span></a></span></span><span>
</span><span id="line-632"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="BlockLabel"><span class="annot"><a href="GHC.Cmm.Info.Build.html#BlockLabel"><span class="hs-identifier hs-var">BlockLabel</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span>
</span><span id="line-633"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DeclLabel"><span class="annot"><a href="GHC.Cmm.Info.Build.html#DeclLabel"><span class="hs-identifier hs-var">DeclLabel</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-634"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681056058"><span id="local-6989586621681056062"><span class="annot"><span class="annottext">SomeLabel -&gt; SomeLabel -&gt; Bool
(SomeLabel -&gt; SomeLabel -&gt; Bool)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; Bool) -&gt; Eq SomeLabel
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: SomeLabel -&gt; SomeLabel -&gt; Bool
$c/= :: SomeLabel -&gt; SomeLabel -&gt; Bool
== :: SomeLabel -&gt; SomeLabel -&gt; Bool
$c== :: SomeLabel -&gt; SomeLabel -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681056034"><span id="local-6989586621681056036"><span id="local-6989586621681056039"><span id="local-6989586621681056042"><span id="local-6989586621681056045"><span id="local-6989586621681056049"><span id="local-6989586621681056054"><span class="annot"><span class="annottext">Eq SomeLabel
Eq SomeLabel
-&gt; (SomeLabel -&gt; SomeLabel -&gt; Ordering)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; Bool)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; Bool)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; Bool)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; Bool)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; SomeLabel)
-&gt; (SomeLabel -&gt; SomeLabel -&gt; SomeLabel)
-&gt; Ord SomeLabel
SomeLabel -&gt; SomeLabel -&gt; Bool
SomeLabel -&gt; SomeLabel -&gt; Ordering
SomeLabel -&gt; SomeLabel -&gt; SomeLabel
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: SomeLabel -&gt; SomeLabel -&gt; SomeLabel
$cmin :: SomeLabel -&gt; SomeLabel -&gt; SomeLabel
max :: SomeLabel -&gt; SomeLabel -&gt; SomeLabel
$cmax :: SomeLabel -&gt; SomeLabel -&gt; SomeLabel
&gt;= :: SomeLabel -&gt; SomeLabel -&gt; Bool
$c&gt;= :: SomeLabel -&gt; SomeLabel -&gt; Bool
&gt; :: SomeLabel -&gt; SomeLabel -&gt; Bool
$c&gt; :: SomeLabel -&gt; SomeLabel -&gt; Bool
&lt;= :: SomeLabel -&gt; SomeLabel -&gt; Bool
$c&lt;= :: SomeLabel -&gt; SomeLabel -&gt; Bool
&lt; :: SomeLabel -&gt; SomeLabel -&gt; Bool
$c&lt; :: SomeLabel -&gt; SomeLabel -&gt; Bool
compare :: SomeLabel -&gt; SomeLabel -&gt; Ordering
$ccompare :: SomeLabel -&gt; SomeLabel -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-635"></span><span>
</span><span id="line-636"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681056031"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-637"></span><span>  </span><span id="local-6989586621681056028"><span class="annot"><span class="annottext">ppr :: SomeLabel -&gt; SDoc
</span><a href="#local-6989586621681056028"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#BlockLabel"><span class="hs-identifier hs-type">BlockLabel</span></a></span><span> </span><span id="local-6989586621681056027"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056027"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;b:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056027"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-638"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#DeclLabel"><span class="hs-identifier hs-type">DeclLabel</span></a></span><span> </span><span id="local-6989586621681056026"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056026"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;s:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056026"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-639"></span><span>
</span><span id="line-640"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getBlockLabel"><span class="hs-identifier hs-type">getBlockLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span>
</span><span id="line-641"></span><span id="getBlockLabel"><span class="annot"><span class="annottext">getBlockLabel :: SomeLabel -&gt; Maybe BlockId
</span><a href="GHC.Cmm.Info.Build.html#getBlockLabel"><span class="hs-identifier hs-var hs-var">getBlockLabel</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#BlockLabel"><span class="hs-identifier hs-type">BlockLabel</span></a></span><span> </span><span id="local-6989586621681056024"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056024"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Maybe BlockId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056024"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-642"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getBlockLabel"><span class="hs-identifier hs-var">getBlockLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#DeclLabel"><span class="hs-identifier hs-type">DeclLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-643"></span><span>
</span><span id="line-644"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getBlockLabels"><span class="hs-identifier hs-type">getBlockLabels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-645"></span><span id="getBlockLabels"><span class="annot"><span class="annottext">getBlockLabels :: [SomeLabel] -&gt; [BlockId]
</span><a href="GHC.Cmm.Info.Build.html#getBlockLabels"><span class="hs-identifier hs-var hs-var">getBlockLabels</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SomeLabel -&gt; Maybe BlockId) -&gt; [SomeLabel] -&gt; [BlockId]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">SomeLabel -&gt; Maybe BlockId
</span><a href="GHC.Cmm.Info.Build.html#getBlockLabel"><span class="hs-identifier hs-var">getBlockLabel</span></a></span><span>
</span><span id="line-646"></span><span>
</span><span id="line-647"></span><span class="hs-comment">-- | Return a (Label,CLabel) pair for each labelled block of a CmmDecl,</span><span>
</span><span id="line-648"></span><span class="hs-comment">--   where the label is</span><span>
</span><span id="line-649"></span><span class="hs-comment">--   - the info label for a continuation or dynamic closure</span><span>
</span><span id="line-650"></span><span class="hs-comment">--   - the closure label for a top-level function (not a CAF)</span><span>
</span><span id="line-651"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getLabelledBlocks"><span class="hs-identifier hs-type">getLabelledBlocks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-652"></span><span id="getLabelledBlocks"><span class="annot"><span class="annottext">getLabelledBlocks :: CmmDecl -&gt; [(SomeLabel, CAFLabel)]
</span><a href="GHC.Cmm.Info.Build.html#getLabelledBlocks"><span class="hs-identifier hs-var hs-var">getLabelledBlocks</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[CmmStatic]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-653"></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-654"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getLabelledBlocks"><span class="hs-identifier hs-var">getLabelledBlocks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-type">CmmStatics</span></a></span><span> </span><span id="local-6989586621681056019"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056019"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-655"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; SomeLabel
</span><a href="GHC.Cmm.Info.Build.html#DeclLabel"><span class="hs-identifier hs-var">DeclLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056019"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var">mkCAFLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681056019"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-656"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getLabelledBlocks"><span class="hs-identifier hs-var">getLabelledBlocks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681056017"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681056017"><span class="hs-identifier hs-var">top_info</span></a></span></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-657"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; SomeLabel
</span><a href="GHC.Cmm.Info.Build.html#BlockLabel"><span class="hs-identifier hs-var">BlockLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056016"><span class="hs-identifier hs-var">blockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681056015"><span class="hs-identifier hs-var">caf_lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-658"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681056016"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681056016"><span class="hs-identifier hs-var">blockId</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681056014"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681056014"><span class="hs-identifier hs-var">info</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable -&gt; [(KeyOf LabelMap, CmmInfoTable)]
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; [(KeyOf map, a)]
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapToList"><span class="hs-identifier hs-var">mapToList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681056017"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-659"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681056011"><span class="annot"><span class="annottext">rep :: SMRep
</span><a href="#local-6989586621681056011"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable -&gt; SMRep
</span><a href="GHC.Cmm.html#cit_rep"><span class="hs-identifier hs-var hs-var">cit_rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681056014"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-660"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isStaticRep"><span class="hs-identifier hs-var">isStaticRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681056011"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isThunkRep"><span class="hs-identifier hs-var">isThunkRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681056011"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-661"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681056015"><span class="annot"><span class="annottext">caf_lbl :: CAFLabel
</span><a href="#local-6989586621681056015"><span class="hs-identifier hs-var hs-var">caf_lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var">mkCAFLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmInfoTable -&gt; CLabel
</span><a href="GHC.Cmm.html#cit_lbl"><span class="hs-identifier hs-var hs-var">cit_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681056014"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-662"></span><span>  </span><span class="hs-special">]</span><span>
</span><span id="line-663"></span><span>
</span><span id="line-664"></span><span class="hs-comment">-- | Put the labelled blocks that we will be annotating with SRTs into</span><span>
</span><span id="line-665"></span><span class="hs-comment">-- dependency order.  This is so that we can process them one at a</span><span>
</span><span id="line-666"></span><span class="hs-comment">-- time, resolving references to earlier blocks to point to their</span><span>
</span><span id="line-667"></span><span class="hs-comment">-- SRTs. CAFs themselves are not included here; see getCAFs below.</span><span>
</span><span id="line-668"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#depAnalSRTs"><span class="hs-identifier hs-type">depAnalSRTs</span></a></span><span>
</span><span id="line-669"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFEnv"><span class="hs-identifier hs-type">CAFEnv</span></a></span><span>
</span><span id="line-670"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span> </span><span class="hs-comment">-- CAFEnv for statics</span><span>
</span><span id="line-671"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-672"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-673"></span><span id="depAnalSRTs"><span class="annot"><span class="annottext">depAnalSRTs :: CAFEnv
-&gt; Map CLabel (Set CAFLabel)
-&gt; [CmmDecl]
-&gt; [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="GHC.Cmm.Info.Build.html#depAnalSRTs"><span class="hs-identifier hs-var hs-var">depAnalSRTs</span></a></span></span><span> </span><span id="local-6989586621681056003"><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681056003"><span class="hs-identifier hs-var">cafEnv</span></a></span></span><span> </span><span id="local-6989586621681056002"><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel)
</span><a href="#local-6989586621681056002"><span class="hs-identifier hs-var">cafEnv_static</span></a></span></span><span> </span><span id="local-6989586621681056001"><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681056001"><span class="hs-identifier hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-674"></span><span>  </span><span class="annot"><span class="annottext">String
-&gt; SDoc
-&gt; [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
-&gt; [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var">srtTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;depAnalSRTs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;decls:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681056001"><span class="hs-identifier hs-var">decls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-675"></span><span>                           </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;nodes:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[(SomeLabel, CAFLabel, Set CAFLabel)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)
 -&gt; (SomeLabel, CAFLabel, Set CAFLabel))
-&gt; [Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)]
-&gt; [(SomeLabel, CAFLabel, Set CAFLabel)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)
-&gt; (SomeLabel, CAFLabel, Set CAFLabel)
forall key payload. Node key payload -&gt; payload
</span><a href="GHC.Data.Graph.Directed.html#node_payload"><span class="hs-identifier hs-var hs-var">node_payload</span></a></span><span> </span><span class="annot"><span class="annottext">[Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055999"><span class="hs-identifier hs-var">nodes</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-676"></span><span>                           </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;graph:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC (SomeLabel, CAFLabel, Set CAFLabel)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055998"><span class="hs-identifier hs-var">graph</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055998"><span class="hs-identifier hs-var">graph</span></a></span><span>
</span><span id="line-677"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-678"></span><span>  </span><span class="annot"><a href="#local-6989586621681055997"><span class="hs-identifier hs-type">labelledBlocks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-679"></span><span>  </span><span id="local-6989586621681055997"><span class="annot"><span class="annottext">labelledBlocks :: [(SomeLabel, CAFLabel)]
</span><a href="#local-6989586621681055997"><span class="hs-identifier hs-var hs-var">labelledBlocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmDecl -&gt; [(SomeLabel, CAFLabel)])
-&gt; [CmmDecl] -&gt; [(SomeLabel, CAFLabel)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; [(SomeLabel, CAFLabel)]
</span><a href="GHC.Cmm.Info.Build.html#getLabelledBlocks"><span class="hs-identifier hs-var">getLabelledBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681056001"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-680"></span><span>  </span><span class="annot"><a href="#local-6989586621681055995"><span class="hs-identifier hs-type">labelToBlock</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span>
</span><span id="line-681"></span><span>  </span><span id="local-6989586621681055995"><span class="annot"><span class="annottext">labelToBlock :: Map CAFLabel SomeLabel
</span><a href="#local-6989586621681055995"><span class="hs-identifier hs-var hs-var">labelToBlock</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Map CAFLabel SomeLabel
 -&gt; (SomeLabel, CAFLabel) -&gt; Map CAFLabel SomeLabel)
-&gt; Map CAFLabel SomeLabel
-&gt; [(SomeLabel, CAFLabel)]
-&gt; Map CAFLabel SomeLabel
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681055994"><span class="annot"><span class="annottext">Map CAFLabel SomeLabel
</span><a href="#local-6989586621681055994"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055993"><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055993"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055992"><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055992"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CAFLabel
-&gt; SomeLabel -&gt; Map CAFLabel SomeLabel -&gt; Map CAFLabel SomeLabel
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055992"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055993"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Map CAFLabel SomeLabel
</span><a href="#local-6989586621681055994"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map CAFLabel SomeLabel
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">[(SomeLabel, CAFLabel)]
</span><a href="#local-6989586621681055997"><span class="hs-identifier hs-var">labelledBlocks</span></a></span><span>
</span><span id="line-682"></span><span>
</span><span id="line-683"></span><span>  </span><span class="annot"><a href="#local-6989586621681055999"><span class="hs-identifier hs-type">nodes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Data.Graph.Directed.html#Node"><span class="hs-identifier hs-type">Node</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-684"></span><span>  </span><span id="local-6989586621681055999"><span class="annot"><span class="annottext">nodes :: [Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055999"><span class="hs-identifier hs-var hs-var">nodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">(SomeLabel, CAFLabel, Set CAFLabel)
-&gt; SomeLabel
-&gt; [SomeLabel]
-&gt; Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)
forall key payload. payload -&gt; key -&gt; [key] -&gt; Node key payload
</span><a href="GHC.Data.Graph.Directed.html#DigraphNode"><span class="hs-identifier hs-var">DigraphNode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055989"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055988"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055987"><span class="hs-identifier hs-var">cafs'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055989"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-685"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CAFLabel -&gt; Maybe SomeLabel) -&gt; [CAFLabel] -&gt; [SomeLabel]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CAFLabel -&gt; Map CAFLabel SomeLabel -&gt; Maybe SomeLabel)
-&gt; Map CAFLabel SomeLabel -&gt; CAFLabel -&gt; Maybe SomeLabel
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">CAFLabel -&gt; Map CAFLabel SomeLabel -&gt; Maybe SomeLabel
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Map CAFLabel SomeLabel
</span><a href="#local-6989586621681055995"><span class="hs-identifier hs-var">labelToBlock</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CAFLabel -&gt; [CAFLabel]
forall a. Set a -&gt; [a]
</span><a href="../../containers/src/Data.Set.Internal.html#toList"><span class="hs-identifier hs-var">Set.toList</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055987"><span class="hs-identifier hs-var">cafs'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-686"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055989"><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055989"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055988"><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055988"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(SomeLabel, CAFLabel)]
</span><a href="#local-6989586621681055997"><span class="hs-identifier hs-var">labelledBlocks</span></a></span><span>
</span><span id="line-687"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055983"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055983"><span class="hs-identifier hs-var">cafs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-688"></span><span>              </span><span class="hs-special">[</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055989"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-689"></span><span>                 </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#BlockLabel"><span class="hs-identifier hs-type">BlockLabel</span></a></span><span> </span><span id="local-6989586621681055982"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055982"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CAFEnv -&gt; Maybe (Set CAFLabel)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681055982"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681056003"><span class="hs-identifier hs-var">cafEnv</span></a></span><span>
</span><span id="line-690"></span><span>                 </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#DeclLabel"><span class="hs-identifier hs-type">DeclLabel</span></a></span><span> </span><span id="local-6989586621681055980"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055980"><span class="hs-identifier hs-var">cl</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Map CLabel (Set CAFLabel) -&gt; Maybe (Set CAFLabel)
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055980"><span class="hs-identifier hs-var">cl</span></a></span><span> </span><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel)
</span><a href="#local-6989586621681056002"><span class="hs-identifier hs-var">cafEnv_static</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-691"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055987"><span class="annot"><span class="annottext">cafs' :: Set CAFLabel
</span><a href="#local-6989586621681055987"><span class="hs-identifier hs-var hs-var">cafs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CAFLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
forall a. Ord a =&gt; a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#delete"><span class="hs-identifier hs-var">Set.delete</span></a></span><span> </span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055988"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055983"><span class="hs-identifier hs-var">cafs</span></a></span><span>
</span><span id="line-692"></span><span>          </span><span class="hs-special">]</span><span>
</span><span id="line-693"></span><span>
</span><span id="line-694"></span><span>  </span><span class="annot"><a href="#local-6989586621681055998"><span class="hs-identifier hs-type">graph</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-695"></span><span>  </span><span id="local-6989586621681055998"><span class="annot"><span class="annottext">graph :: [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055998"><span class="hs-identifier hs-var hs-var">graph</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)]
-&gt; [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
forall key payload. Ord key =&gt; [Node key payload] -&gt; [SCC payload]
</span><a href="GHC.Data.Graph.Directed.html#stronglyConnCompFromEdgedVerticesOrd"><span class="hs-identifier hs-var">stronglyConnCompFromEdgedVerticesOrd</span></a></span><span> </span><span class="annot"><span class="annottext">[Node SomeLabel (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055999"><span class="hs-identifier hs-var">nodes</span></a></span><span>
</span><span id="line-696"></span><span>
</span><span id="line-697"></span><span class="hs-comment">-- | Get (Label, CAFLabel, Set CAFLabel) for each block that represents a CAF.</span><span>
</span><span id="line-698"></span><span class="hs-comment">-- These are treated differently from other labelled blocks:</span><span>
</span><span id="line-699"></span><span class="hs-comment">--  - we never shortcut a reference to a CAF to the contents of its</span><span>
</span><span id="line-700"></span><span class="hs-comment">--    SRT, since the point of SRTs is to keep CAFs alive.</span><span>
</span><span id="line-701"></span><span class="hs-comment">--  - CAFs therefore don't take part in the dependency analysis in depAnalSRTs.</span><span>
</span><span id="line-702"></span><span class="hs-comment">--    instead we generate their SRTs after everything else.</span><span>
</span><span id="line-703"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getCAFs"><span class="hs-identifier hs-type">getCAFs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFEnv"><span class="hs-identifier hs-type">CAFEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-704"></span><span id="getCAFs"><span class="annot"><span class="annottext">getCAFs :: CAFEnv -&gt; [CmmDecl] -&gt; [(BlockId, CAFLabel, Set CAFLabel)]
</span><a href="GHC.Cmm.Info.Build.html#getCAFs"><span class="hs-identifier hs-var hs-var">getCAFs</span></a></span></span><span> </span><span id="local-6989586621681055976"><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681055976"><span class="hs-identifier hs-var">cafEnv</span></a></span></span><span> </span><span id="local-6989586621681055975"><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055975"><span class="hs-identifier hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-705"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055974"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var">mkCAFLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055973"><span class="hs-identifier hs-var">topLbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055972"><span class="hs-identifier hs-var">cafs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-706"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681055971"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055971"><span class="hs-identifier hs-var">top_info</span></a></span></span><span> </span><span id="local-6989586621681055973"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055973"><span class="hs-identifier hs-var">topLbl</span></a></span></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681055974"><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055974"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055975"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-707"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055970"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055970"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmInfoTable -&gt; Maybe CmmInfoTable
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055974"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055971"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-708"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055969"><span class="annot"><span class="annottext">rep :: SMRep
</span><a href="#local-6989586621681055969"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable -&gt; SMRep
</span><a href="GHC.Cmm.html#cit_rep"><span class="hs-identifier hs-var hs-var">cit_rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055970"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-709"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isStaticRep"><span class="hs-identifier hs-var">isStaticRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055969"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isThunkRep"><span class="hs-identifier hs-var">isThunkRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055969"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-710"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055972"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055972"><span class="hs-identifier hs-var">cafs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CAFEnv -&gt; Maybe (Set CAFLabel)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055974"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681055976"><span class="hs-identifier hs-var">cafEnv</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-711"></span><span>  </span><span class="hs-special">]</span><span>
</span><span id="line-712"></span><span>
</span><span id="line-713"></span><span>
</span><span id="line-714"></span><span class="hs-comment">-- | Get the list of blocks that correspond to the entry points for</span><span>
</span><span id="line-715"></span><span class="hs-comment">-- FUN_STATIC closures.  These are the blocks for which if we have an</span><span>
</span><span id="line-716"></span><span class="hs-comment">-- SRT we can merge it with the static closure. [FUN]</span><span>
</span><span id="line-717"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#getStaticFuns"><span class="hs-identifier hs-type">getStaticFuns</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-718"></span><span id="getStaticFuns"><span class="annot"><span class="annottext">getStaticFuns :: [CmmDecl] -&gt; [(BlockId, CLabel)]
</span><a href="GHC.Cmm.Info.Build.html#getStaticFuns"><span class="hs-identifier hs-var hs-var">getStaticFuns</span></a></span></span><span> </span><span id="local-6989586621681055966"><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055966"><span class="hs-identifier hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-719"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055965"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055964"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-720"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681055963"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055963"><span class="hs-identifier hs-var">top_info</span></a></span></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681055965"><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055965"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055966"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-721"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055962"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055962"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmInfoTable -&gt; Maybe CmmInfoTable
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055965"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055963"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-722"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055961"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681055961"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmInfoTable -&gt; Maybe (Id, CostCentreStack)
</span><a href="GHC.Cmm.html#cit_clo"><span class="hs-identifier hs-var hs-var">cit_clo</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055962"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-723"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055959"><span class="annot"><span class="annottext">rep :: SMRep
</span><a href="#local-6989586621681055959"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable -&gt; SMRep
</span><a href="GHC.Cmm.html#cit_rep"><span class="hs-identifier hs-var hs-var">cit_rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055962"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-724"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isStaticRep"><span class="hs-identifier hs-var">isStaticRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055959"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isFunRep"><span class="hs-identifier hs-var">isFunRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055959"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-725"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681055964"><span class="annot"><span class="annottext">lbl :: CLabel
</span><a href="#local-6989586621681055964"><span class="hs-identifier hs-var hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; CafInfo -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkLocalClosureLabel"><span class="hs-identifier hs-var">mkLocalClosureLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681055961"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CafInfo
</span><a href="GHC.Types.Id.html#idCafInfo"><span class="hs-identifier hs-var">idCafInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681055961"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span>  </span><span class="hs-special">]</span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span>
</span><span id="line-729"></span><span class="hs-comment">-- | Maps labels from 'cafAnal' to the final CLabel that will appear</span><span>
</span><span id="line-730"></span><span class="hs-comment">-- in the SRT.</span><span>
</span><span id="line-731"></span><span class="hs-comment">--   - closures with singleton SRTs resolve to their single entry</span><span>
</span><span id="line-732"></span><span class="hs-comment">--   - closures with larger SRTs map to the label for that SRT</span><span>
</span><span id="line-733"></span><span class="hs-comment">--   - CAFs must not map to anything!</span><span>
</span><span id="line-734"></span><span class="hs-comment">--   - if a labels maps to Nothing, we found that this label's SRT</span><span>
</span><span id="line-735"></span><span class="hs-comment">--     is empty, so we don't need to refer to it from other SRTs.</span><span>
</span><span id="line-736"></span><span class="hs-keyword">type</span><span> </span><span id="SRTMap"><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTMap"><span class="hs-identifier hs-var">SRTMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-737"></span><span>
</span><span id="line-738"></span><span>
</span><span id="line-739"></span><span class="hs-comment">-- | Given 'SRTMap' of a module, returns the set of non-CAFFY names in the</span><span>
</span><span id="line-740"></span><span class="hs-comment">-- module.  Any 'Name's not in the set are CAFFY.</span><span>
</span><span id="line-741"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#srtMapNonCAFs"><span class="hs-identifier hs-type">srtMapNonCAFs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTMap"><span class="hs-identifier hs-type">SRTMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#NonCaffySet"><span class="hs-identifier hs-type">NonCaffySet</span></a></span><span>
</span><span id="line-742"></span><span id="srtMapNonCAFs"><span class="annot"><span class="annottext">srtMapNonCAFs :: SRTMap -&gt; NonCaffySet
</span><a href="GHC.Cmm.Info.Build.html#srtMapNonCAFs"><span class="hs-identifier hs-var hs-var">srtMapNonCAFs</span></a></span></span><span> </span><span id="local-6989586621681055954"><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055954"><span class="hs-identifier hs-var">srtMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-743"></span><span>    </span><span class="annot"><span class="annottext">NameSet -&gt; NonCaffySet
</span><a href="GHC.Types.Name.Set.html#NonCaffySet"><span class="hs-identifier hs-var">NonCaffySet</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSet -&gt; NonCaffySet) -&gt; NameSet -&gt; NonCaffySet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((CAFLabel, Maybe SRTEntry) -&gt; Maybe Name)
-&gt; [(CAFLabel, Maybe SRTEntry)] -&gt; [Name]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">(CAFLabel, Maybe SRTEntry) -&gt; Maybe Name
forall {a}. (CAFLabel, Maybe a) -&gt; Maybe Name
</span><a href="#local-6989586621681055951"><span class="hs-identifier hs-var">get_name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTMap -&gt; [(CAFLabel, Maybe SRTEntry)]
forall k a. Map k a -&gt; [(k, a)]
</span><a href="../../containers/src/Data.Map.Internal.html#toList"><span class="hs-identifier hs-var">Map.toList</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055954"><span class="hs-identifier hs-var">srtMap</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-744"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-745"></span><span>    </span><span id="local-6989586621681055951"><span class="annot"><span class="annottext">get_name :: (CAFLabel, Maybe a) -&gt; Maybe Name
</span><a href="#local-6989586621681055951"><span class="hs-identifier hs-var hs-var">get_name</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span id="local-6989586621681055949"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055949"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Maybe Name
</span><a href="GHC.Cmm.CLabel.html#hasHaskellName"><span class="hs-identifier hs-var">hasHaskellName</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055949"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-746"></span><span>    </span><span class="annot"><a href="#local-6989586621681055951"><span class="hs-identifier hs-var">get_name</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055948"><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055948"><span class="hs-identifier hs-var">_l</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055947"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681055947"><span class="hs-identifier hs-var">_srt_entry</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-747"></span><span>
</span><span id="line-748"></span><span class="hs-comment">-- | resolve a CAFLabel to its SRTEntry using the SRTMap</span><span>
</span><span id="line-749"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#resolveCAF"><span class="hs-identifier hs-type">resolveCAF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTMap"><span class="hs-identifier hs-type">SRTMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span>
</span><span id="line-750"></span><span id="resolveCAF"><span class="annot"><span class="annottext">resolveCAF :: SRTMap -&gt; CAFLabel -&gt; Maybe SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#resolveCAF"><span class="hs-identifier hs-var hs-var">resolveCAF</span></a></span></span><span> </span><span id="local-6989586621681055945"><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055945"><span class="hs-identifier hs-var">srtMap</span></a></span></span><span> </span><span id="local-6989586621681055944"><span class="annot"><span class="annottext">lbl :: CAFLabel
</span><a href="#local-6989586621681055944"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span id="local-6989586621681055943"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055943"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-751"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Maybe SRTEntry -&gt; Maybe SRTEntry
forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var">srtTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;resolveCAF&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;l:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055943"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;resolved:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055942"><span class="hs-identifier hs-var">ret</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055942"><span class="hs-identifier hs-var">ret</span></a></span><span>
</span><span id="line-752"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-753"></span><span>    </span><span id="local-6989586621681055942"><span class="annot"><span class="annottext">ret :: Maybe SRTEntry
</span><a href="#local-6989586621681055942"><span class="hs-identifier hs-var hs-var">ret</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; CAFLabel -&gt; SRTMap -&gt; Maybe SRTEntry
forall k a. Ord k =&gt; a -&gt; k -&gt; Map k a -&gt; a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#findWithDefault"><span class="hs-identifier hs-var">Map.findWithDefault</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTEntry -&gt; Maybe SRTEntry
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-var">SRTEntry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#toClosureLbl"><span class="hs-identifier hs-var">toClosureLbl</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055943"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055944"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055945"><span class="hs-identifier hs-var">srtMap</span></a></span><span>
</span><span id="line-754"></span><span>
</span><span id="line-755"></span><span class="hs-comment">-- | Attach SRTs to all info tables in the CmmDecls, and add SRT</span><span>
</span><span id="line-756"></span><span class="hs-comment">-- declarations to the ModuleSRTInfo.</span><span>
</span><span id="line-757"></span><span class="hs-comment">--</span><span>
</span><span id="line-758"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#doSRTs"><span class="hs-identifier hs-type">doSRTs</span></a></span><span>
</span><span id="line-759"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-760"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span>
</span><span id="line-761"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFEnv"><span class="hs-identifier hs-type">CAFEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-762"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-763"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-764"></span><span>
</span><span id="line-765"></span><span id="doSRTs"><span class="annot"><span class="annottext">doSRTs :: DynFlags
-&gt; ModuleSRTInfo
-&gt; [(CAFEnv, [CmmDecl])]
-&gt; [(Set CAFLabel, CmmDecl)]
-&gt; IO (ModuleSRTInfo, [CmmDeclSRTs])
</span><a href="GHC.Cmm.Info.Build.html#doSRTs"><span class="hs-identifier hs-var hs-var">doSRTs</span></a></span></span><span> </span><span id="local-6989586621681055940"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055940"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055939"><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055939"><span class="hs-identifier hs-var">moduleSRTInfo</span></a></span></span><span> </span><span id="local-6989586621681055938"><span class="annot"><span class="annottext">[(CAFEnv, [CmmDecl])]
</span><a href="#local-6989586621681055938"><span class="hs-identifier hs-var">procs</span></a></span></span><span> </span><span id="local-6989586621681055937"><span class="annot"><span class="annottext">[(Set CAFLabel, CmmDecl)]
</span><a href="#local-6989586621681055937"><span class="hs-identifier hs-var">data_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-766"></span><span>  </span><span id="local-6989586621681055936"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681055936"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'u'</span></span><span>
</span><span id="line-767"></span><span>
</span><span id="line-768"></span><span>  </span><span class="hs-comment">-- Ignore the original grouping of decls, and combine all the</span><span>
</span><span id="line-769"></span><span>  </span><span class="hs-comment">-- CAFEnvs into a single CAFEnv.</span><span>
</span><span id="line-770"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681055934"><span class="hs-identifier hs-type">static_data_env</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFSet"><span class="hs-identifier hs-type">CAFSet</span></a></span><span>
</span><span id="line-771"></span><span>      </span><span id="local-6989586621681055934"><span class="annot"><span class="annottext">static_data_env :: Map CLabel (Set CAFLabel)
</span><a href="#local-6989586621681055934"><span class="hs-identifier hs-var hs-var">static_data_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-772"></span><span>        </span><span class="annot"><span class="annottext">[(CLabel, Set CAFLabel)] -&gt; Map CLabel (Set CAFLabel)
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">([(CLabel, Set CAFLabel)] -&gt; Map CLabel (Set CAFLabel))
-&gt; [(CLabel, Set CAFLabel)] -&gt; Map CLabel (Set CAFLabel)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-773"></span><span>        </span><span class="annot"><span class="annottext">(((Set CAFLabel, CmmDecl) -&gt; (CLabel, Set CAFLabel))
 -&gt; [(Set CAFLabel, CmmDecl)] -&gt; [(CLabel, Set CAFLabel)])
-&gt; [(Set CAFLabel, CmmDecl)]
-&gt; ((Set CAFLabel, CmmDecl) -&gt; (CLabel, Set CAFLabel))
-&gt; [(CLabel, Set CAFLabel)]
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">((Set CAFLabel, CmmDecl) -&gt; (CLabel, Set CAFLabel))
-&gt; [(Set CAFLabel, CmmDecl)] -&gt; [(CLabel, Set CAFLabel)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">[(Set CAFLabel, CmmDecl)]
</span><a href="#local-6989586621681055937"><span class="hs-identifier hs-var">data_</span></a></span><span> </span><span class="annot"><span class="annottext">(((Set CAFLabel, CmmDecl) -&gt; (CLabel, Set CAFLabel))
 -&gt; [(CLabel, Set CAFLabel)])
-&gt; ((Set CAFLabel, CmmDecl) -&gt; (CLabel, Set CAFLabel))
-&gt; [(CLabel, Set CAFLabel)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-774"></span><span>        </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681055932"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055932"><span class="hs-identifier hs-var">set</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055931"><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681055931"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-775"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681055931"><span class="hs-identifier hs-var">decl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-776"></span><span>            </span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-777"></span><span>              </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (CLabel, Set CAFLabel)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doSRTs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Proc in static data list:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681055931"><span class="hs-identifier hs-var">decl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-778"></span><span>            </span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681055929"><span class="annot"><span class="annottext">GenCmmStatics 'False
</span><a href="#local-6989586621681055929"><span class="hs-identifier hs-var">static</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-779"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GenCmmStatics 'False
</span><a href="#local-6989586621681055929"><span class="hs-identifier hs-var">static</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-780"></span><span>                </span><span class="annot"><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-type">CmmStatics</span></a></span><span> </span><span id="local-6989586621681055927"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055927"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055927"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055932"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-781"></span><span>                </span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681055926"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055926"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="annot"><span class="annottext">[CmmStatic]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055926"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055932"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span>      </span><span class="annot"><a href="#local-6989586621681055925"><span class="hs-identifier hs-type">static_data</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-784"></span><span>      </span><span id="local-6989586621681055925"><span class="annot"><span class="annottext">static_data :: Set CLabel
</span><a href="#local-6989586621681055925"><span class="hs-identifier hs-var hs-var">static_data</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel) -&gt; Set CLabel
forall k a. Map k a -&gt; Set k
</span><a href="../../containers/src/Data.Map.Internal.html#keysSet"><span class="hs-identifier hs-var">Map.keysSet</span></a></span><span> </span><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel)
</span><a href="#local-6989586621681055934"><span class="hs-identifier hs-var">static_data_env</span></a></span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681055923"><span class="annot"><span class="annottext">[CAFEnv]
</span><a href="#local-6989586621681055923"><span class="hs-identifier hs-var">proc_envs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055922"><span class="annot"><span class="annottext">[[CmmDecl]]
</span><a href="#local-6989586621681055922"><span class="hs-identifier hs-var">procss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(CAFEnv, [CmmDecl])] -&gt; ([CAFEnv], [[CmmDecl]])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(CAFEnv, [CmmDecl])]
</span><a href="#local-6989586621681055938"><span class="hs-identifier hs-var">procs</span></a></span><span>
</span><span id="line-787"></span><span>      </span><span id="local-6989586621681055920"><span class="annot"><span class="annottext">cafEnv :: CAFEnv
</span><a href="#local-6989586621681055920"><span class="hs-identifier hs-var hs-var">cafEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CAFEnv] -&gt; CAFEnv
forall (map :: * -&gt; *) a. IsMap map =&gt; [map a] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapUnions"><span class="hs-identifier hs-var">mapUnions</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFEnv]
</span><a href="#local-6989586621681055923"><span class="hs-identifier hs-var">proc_envs</span></a></span><span>
</span><span id="line-788"></span><span>      </span><span id="local-6989586621681055918"><span class="annot"><span class="annottext">decls :: [CmmDecl]
</span><a href="#local-6989586621681055918"><span class="hs-identifier hs-var hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Set CAFLabel, CmmDecl) -&gt; CmmDecl)
-&gt; [(Set CAFLabel, CmmDecl)] -&gt; [CmmDecl]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Set CAFLabel, CmmDecl) -&gt; CmmDecl
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">[(Set CAFLabel, CmmDecl)]
</span><a href="#local-6989586621681055937"><span class="hs-identifier hs-var">data_</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl] -&gt; [CmmDecl] -&gt; [CmmDecl]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[CmmDecl]] -&gt; [CmmDecl]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[CmmDecl]]
</span><a href="#local-6989586621681055922"><span class="hs-identifier hs-var">procss</span></a></span><span>
</span><span id="line-789"></span><span>      </span><span id="local-6989586621681055916"><span class="annot"><span class="annottext">staticFuns :: LabelMap CLabel
</span><a href="#local-6989586621681055916"><span class="hs-identifier hs-var hs-var">staticFuns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, CLabel)] -&gt; LabelMap CLabel
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmDecl] -&gt; [(BlockId, CLabel)]
</span><a href="GHC.Cmm.Info.Build.html#getStaticFuns"><span class="hs-identifier hs-var">getStaticFuns</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055918"><span class="hs-identifier hs-var">decls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-790"></span><span>
</span><span id="line-791"></span><span>  </span><span class="hs-comment">-- Put the decls in dependency order. Why? So that we can implement</span><span>
</span><span id="line-792"></span><span>  </span><span class="hs-comment">-- [Inline] and [Filter].  If we need to refer to an SRT that has</span><span>
</span><span id="line-793"></span><span>  </span><span class="hs-comment">-- a single entry, we use the entry itself, which means that we</span><span>
</span><span id="line-794"></span><span>  </span><span class="hs-comment">-- don't need to generate the singleton SRT in the first place.  But</span><span>
</span><span id="line-795"></span><span>  </span><span class="hs-comment">-- to do this we need to process blocks before things that depend on</span><span>
</span><span id="line-796"></span><span>  </span><span class="hs-comment">-- them.</span><span>
</span><span id="line-797"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-798"></span><span>    </span><span class="annot"><a href="#local-6989586621681055914"><span class="hs-identifier hs-type">sccs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-799"></span><span>    </span><span id="local-6989586621681055914"><span class="annot"><span class="annottext">sccs :: [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055914"><span class="hs-identifier hs-var hs-var">sccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">depAnalSRTs</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">CAFEnv
-&gt; Map CLabel (Set CAFLabel)
-&gt; [CmmDecl]
-&gt; [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="GHC.Cmm.Info.Build.html#depAnalSRTs"><span class="hs-identifier hs-var">depAnalSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681055920"><span class="hs-identifier hs-var">cafEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel)
</span><a href="#local-6989586621681055934"><span class="hs-identifier hs-var">static_data_env</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055918"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-800"></span><span>
</span><span id="line-801"></span><span>    </span><span class="annot"><a href="#local-6989586621681055913"><span class="hs-identifier hs-type">cafsWithSRTs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-802"></span><span>    </span><span id="local-6989586621681055913"><span class="annot"><span class="annottext">cafsWithSRTs :: [(BlockId, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055913"><span class="hs-identifier hs-var hs-var">cafsWithSRTs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CAFEnv -&gt; [CmmDecl] -&gt; [(BlockId, CAFLabel, Set CAFLabel)]
</span><a href="GHC.Cmm.Info.Build.html#getCAFs"><span class="hs-identifier hs-var">getCAFs</span></a></span><span> </span><span class="annot"><span class="annottext">CAFEnv
</span><a href="#local-6989586621681055920"><span class="hs-identifier hs-var">cafEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055918"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-803"></span><span>
</span><span id="line-804"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doSRTs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;data:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[(Set CAFLabel, CmmDecl)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[(Set CAFLabel, CmmDecl)]
</span><a href="#local-6989586621681055937"><span class="hs-identifier hs-var">data_</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-805"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;procs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[(CAFEnv, [CmmDecl])] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[(CAFEnv, [CmmDecl])]
</span><a href="#local-6989586621681055938"><span class="hs-identifier hs-var">procs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-806"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;static_data_env:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Map CLabel (Set CAFLabel)
</span><a href="#local-6989586621681055934"><span class="hs-identifier hs-var">static_data_env</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-807"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sccs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC (SomeLabel, CAFLabel, Set CAFLabel)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055914"><span class="hs-identifier hs-var">sccs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-808"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cafsWithSRTs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CAFLabel, Set CAFLabel)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055913"><span class="hs-identifier hs-var">cafsWithSRTs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-809"></span><span>
</span><span id="line-810"></span><span>  </span><span class="hs-comment">-- On each strongly-connected group of decls, construct the SRT</span><span>
</span><span id="line-811"></span><span>  </span><span class="hs-comment">-- closures and the SRT fields for info tables.</span><span>
</span><span id="line-812"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681055911"><span class="hs-identifier hs-type">result</span></a></span><span> </span><span class="hs-glyph">::</span><span>
</span><span id="line-813"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">]</span><span>          </span><span class="hs-comment">-- generated SRTs</span><span>
</span><span id="line-814"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- SRT fields for info tables</span><span>
</span><span id="line-815"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- SRTs to attach to static functions</span><span>
</span><span id="line-816"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                   </span><span class="hs-comment">-- Whether the group has CAF references</span><span>
</span><span id="line-817"></span><span>          </span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-818"></span><span>
</span><span id="line-819"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681055911"><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
</span><a href="#local-6989586621681055911"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055910"><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055910"><span class="hs-identifier hs-var">moduleSRTInfo'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-820"></span><span>        </span><span class="annot"><span class="annottext">UniqSupply
-&gt; UniqSM
     ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool)],
      ModuleSRTInfo)
-&gt; ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
      Bool)],
    ModuleSRTInfo)
forall a. UniqSupply -&gt; UniqSM a -&gt; a
</span><a href="GHC.Types.Unique.Supply.html#initUs_"><span class="hs-identifier hs-var">initUs_</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681055936"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqSM
   ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
      Bool)],
    ModuleSRTInfo)
 -&gt; ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)],
     ModuleSRTInfo))
-&gt; UniqSM
     ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool)],
      ModuleSRTInfo)
-&gt; ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
      Bool)],
    ModuleSRTInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-821"></span><span>        </span><span class="annot"><span class="annottext">(StateT
   ModuleSRTInfo
   UniqSM
   [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
     Bool)]
 -&gt; ModuleSRTInfo
 -&gt; UniqSM
      ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
         Bool)],
       ModuleSRTInfo))
-&gt; ModuleSRTInfo
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)]
-&gt; UniqSM
     ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool)],
      ModuleSRTInfo)
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">StateT
  ModuleSRTInfo
  UniqSM
  [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
    Bool)]
-&gt; ModuleSRTInfo
-&gt; UniqSM
     ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool)],
      ModuleSRTInfo)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">runStateT</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055939"><span class="hs-identifier hs-var">moduleSRTInfo</span></a></span><span> </span><span class="annot"><span class="annottext">(StateT
   ModuleSRTInfo
   UniqSM
   [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
     Bool)]
 -&gt; UniqSM
      ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
         Bool)],
       ModuleSRTInfo))
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)]
-&gt; UniqSM
     ([([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool)],
      ModuleSRTInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-822"></span><span>          </span><span id="local-6989586621681055907"><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
</span><a href="#local-6989586621681055907"><span class="hs-identifier hs-var">nonCAFs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(SCC (SomeLabel, CAFLabel, Set CAFLabel)
 -&gt; StateT
      ModuleSRTInfo
      UniqSM
      ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool))
-&gt; [SCC (SomeLabel, CAFLabel, Set CAFLabel)]
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags
-&gt; LabelMap CLabel
-&gt; Set CLabel
-&gt; SCC (SomeLabel, CAFLabel, Set CAFLabel)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
</span><a href="GHC.Cmm.Info.Build.html#doSCC"><span class="hs-identifier hs-var">doSCC</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055940"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055916"><span class="hs-identifier hs-var">staticFuns</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055925"><span class="hs-identifier hs-var">static_data</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SCC (SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055914"><span class="hs-identifier hs-var">sccs</span></a></span><span>
</span><span id="line-823"></span><span>          </span><span id="local-6989586621681055904"><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
</span><a href="#local-6989586621681055904"><span class="hs-identifier hs-var">cAFs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(BlockId, CAFLabel, Set CAFLabel)]
-&gt; ((BlockId, CAFLabel, Set CAFLabel)
    -&gt; StateT
         ModuleSRTInfo
         UniqSM
         ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
          Bool))
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055913"><span class="hs-identifier hs-var">cafsWithSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">(((BlockId, CAFLabel, Set CAFLabel)
  -&gt; StateT
       ModuleSRTInfo
       UniqSM
       ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool))
 -&gt; StateT
      ModuleSRTInfo
      UniqSM
      [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
        Bool)])
-&gt; ((BlockId, CAFLabel, Set CAFLabel)
    -&gt; StateT
         ModuleSRTInfo
         UniqSM
         ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
          Bool))
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681055902"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055902"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055901"><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055901"><span class="hs-identifier hs-var">cafLbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055900"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055900"><span class="hs-identifier hs-var">cafs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-824"></span><span>            </span><span class="annot"><span class="annottext">DynFlags
-&gt; LabelMap CLabel
-&gt; [SomeLabel]
-&gt; [CAFLabel]
-&gt; Bool
-&gt; Set CAFLabel
-&gt; Set CLabel
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
</span><a href="GHC.Cmm.Info.Build.html#oneSRT"><span class="hs-identifier hs-var">oneSRT</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055940"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055916"><span class="hs-identifier hs-var">staticFuns</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">BlockId -&gt; SomeLabel
</span><a href="GHC.Cmm.Info.Build.html#BlockLabel"><span class="hs-identifier hs-var">BlockLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055902"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055901"><span class="hs-identifier hs-var">cafLbl</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-825"></span><span>                   </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-comment">{-is a CAF-}</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055900"><span class="hs-identifier hs-var">cafs</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055925"><span class="hs-identifier hs-var">static_data</span></a></span><span>
</span><span id="line-826"></span><span>          </span><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
       Bool)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
</span><a href="#local-6989586621681055907"><span class="hs-identifier hs-var">nonCAFs</span></a></span><span> </span><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
-&gt; [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
     Bool)]
-&gt; [([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
     Bool)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
</span><a href="#local-6989586621681055904"><span class="hs-identifier hs-var">cAFs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span>
</span><span id="line-828"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681055898"><span class="annot"><span class="annottext">[[CmmDeclSRTs]]
</span><a href="#local-6989586621681055898"><span class="hs-identifier hs-var">srt_declss</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055897"><span class="annot"><span class="annottext">[[(BlockId, CLabel)]]
</span><a href="#local-6989586621681055897"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055896"><span class="annot"><span class="annottext">[[(BlockId, [SRTEntry])]]
</span><a href="#local-6989586621681055896"><span class="hs-identifier hs-var">funSRTs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055895"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621681055895"><span class="hs-identifier hs-var">has_caf_refs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
-&gt; ([[CmmDeclSRTs]], [[(BlockId, CLabel)]],
    [[(BlockId, [SRTEntry])]], [Bool])
forall a b c d. [(a, b, c, d)] -&gt; ([a], [b], [c], [d])
</span><a href="../../base/src/Data.OldList.html#unzip4"><span class="hs-identifier hs-var">unzip4</span></a></span><span> </span><span class="annot"><span class="annottext">[([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])],
  Bool)]
</span><a href="#local-6989586621681055911"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-829"></span><span>      </span><span id="local-6989586621681055893"><span class="annot"><span class="annottext">srt_decls :: [CmmDeclSRTs]
</span><a href="#local-6989586621681055893"><span class="hs-identifier hs-var hs-var">srt_decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[CmmDeclSRTs]] -&gt; [CmmDeclSRTs]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[CmmDeclSRTs]]
</span><a href="#local-6989586621681055898"><span class="hs-identifier hs-var">srt_declss</span></a></span><span>
</span><span id="line-830"></span><span>
</span><span id="line-831"></span><span>  </span><span class="hs-comment">-- Next, update the info tables with the SRTs</span><span>
</span><span id="line-832"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-833"></span><span>    </span><span id="local-6989586621681055890"><span class="annot"><span class="annottext">srtFieldMap :: LabelMap CLabel
</span><a href="#local-6989586621681055890"><span class="hs-identifier hs-var hs-var">srtFieldMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, CLabel)] -&gt; LabelMap CLabel
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[(BlockId, CLabel)]] -&gt; [(BlockId, CLabel)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[(BlockId, CLabel)]]
</span><a href="#local-6989586621681055897"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-834"></span><span>    </span><span id="local-6989586621681055887"><span class="annot"><span class="annottext">funSRTMap :: LabelMap [SRTEntry]
</span><a href="#local-6989586621681055887"><span class="hs-identifier hs-var hs-var">funSRTMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, [SRTEntry])] -&gt; LabelMap [SRTEntry]
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[(BlockId, [SRTEntry])]] -&gt; [(BlockId, [SRTEntry])]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[(BlockId, [SRTEntry])]]
</span><a href="#local-6989586621681055896"><span class="hs-identifier hs-var">funSRTs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-835"></span><span>    </span><span id="local-6989586621681055885"><span class="annot"><span class="annottext">has_caf_refs' :: Bool
</span><a href="#local-6989586621681055885"><span class="hs-identifier hs-var hs-var">has_caf_refs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#or"><span class="hs-identifier hs-var">or</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621681055895"><span class="hs-identifier hs-var">has_caf_refs</span></a></span><span>
</span><span id="line-836"></span><span>    </span><span id="local-6989586621681055883"><span class="annot"><span class="annottext">decls' :: [CmmDeclSRTs]
</span><a href="#local-6989586621681055883"><span class="hs-identifier hs-var hs-var">decls'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-837"></span><span>      </span><span class="annot"><span class="annottext">(CmmDecl -&gt; [CmmDeclSRTs]) -&gt; [CmmDecl] -&gt; [CmmDeclSRTs]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags
-&gt; LabelMap CLabel
-&gt; LabelMap [SRTEntry]
-&gt; Bool
-&gt; CmmDecl
-&gt; [CmmDeclSRTs]
</span><a href="GHC.Cmm.Info.Build.html#updInfoSRTs"><span class="hs-identifier hs-var">updInfoSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055940"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055890"><span class="hs-identifier hs-var">srtFieldMap</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap [SRTEntry]
</span><a href="#local-6989586621681055887"><span class="hs-identifier hs-var">funSRTMap</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055885"><span class="hs-identifier hs-var">has_caf_refs'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681055918"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-838"></span><span>
</span><span id="line-839"></span><span>  </span><span class="hs-comment">-- Finally update CafInfos for raw static literals (CmmStaticsRaw). Those are</span><span>
</span><span id="line-840"></span><span>  </span><span class="hs-comment">-- not analysed in oneSRT so we never add entries for them to the SRTMap.</span><span>
</span><span id="line-841"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055881"><span class="annot"><span class="annottext">srtMap_w_raws :: SRTMap
</span><a href="#local-6989586621681055881"><span class="hs-identifier hs-var hs-var">srtMap_w_raws</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-842"></span><span>        </span><span class="annot"><span class="annottext">(SRTMap -&gt; (Set CAFLabel, CmmDecl) -&gt; SRTMap)
-&gt; SRTMap -&gt; [(Set CAFLabel, CmmDecl)] -&gt; SRTMap
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681055880"><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055880"><span class="hs-identifier hs-var">srtMap</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTMap"><span class="hs-identifier hs-type">SRTMap</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CAFLabel
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055879"><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681055879"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-843"></span><span>                  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681055879"><span class="hs-identifier hs-var">decl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-844"></span><span>                    </span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-type">CmmStatics</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-845"></span><span>                      </span><span class="hs-comment">-- already updated by oneSRT</span><span>
</span><span id="line-846"></span><span>                      </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055880"><span class="hs-identifier hs-var">srtMap</span></a></span><span>
</span><span id="line-847"></span><span>                    </span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681055877"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055877"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="annot"><span class="annottext">[CmmStatic]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-848"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#isIdLabel"><span class="hs-identifier hs-var">isIdLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055877"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#isTickyLabel"><span class="hs-identifier hs-var">isTickyLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055877"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-849"></span><span>                          </span><span class="hs-comment">-- Raw data are not analysed by oneSRT and they can't</span><span>
</span><span id="line-850"></span><span>                          </span><span class="hs-comment">-- be CAFFY.</span><span>
</span><span id="line-851"></span><span>                          </span><span class="hs-comment">-- See Note [Ticky labels in SRT analysis] above for</span><span>
</span><span id="line-852"></span><span>                          </span><span class="hs-comment">-- why we exclude ticky labels here.</span><span>
</span><span id="line-853"></span><span>                          </span><span class="annot"><span class="annottext">CAFLabel -&gt; Maybe SRTEntry -&gt; SRTMap -&gt; SRTMap
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CAFLabel
</span><a href="GHC.Cmm.Info.Build.html#mkCAFLabel"><span class="hs-identifier hs-var">mkCAFLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055877"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055880"><span class="hs-identifier hs-var">srtMap</span></a></span><span>
</span><span id="line-854"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-855"></span><span>                          </span><span class="hs-comment">-- Not an IdLabel, ignore</span><span>
</span><span id="line-856"></span><span>                          </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055880"><span class="hs-identifier hs-var">srtMap</span></a></span><span>
</span><span id="line-857"></span><span>                    </span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-858"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; SRTMap
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doSRTs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Found Proc in static data list:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681055879"><span class="hs-identifier hs-var">decl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-859"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var hs-var">moduleSRTMap</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055910"><span class="hs-identifier hs-var">moduleSRTInfo'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Set CAFLabel, CmmDecl)]
</span><a href="#local-6989586621681055937"><span class="hs-identifier hs-var">data_</span></a></span><span>
</span><span id="line-860"></span><span>
</span><span id="line-861"></span><span>  </span><span class="annot"><span class="annottext">(ModuleSRTInfo, [CmmDeclSRTs]) -&gt; IO (ModuleSRTInfo, [CmmDeclSRTs])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055910"><span class="hs-identifier hs-var">moduleSRTInfo'</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">moduleSRTMap :: SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var">moduleSRTMap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055881"><span class="hs-identifier hs-var">srtMap_w_raws</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055893"><span class="hs-identifier hs-var">srt_decls</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDeclSRTs] -&gt; [CmmDeclSRTs] -&gt; [CmmDeclSRTs]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055883"><span class="hs-identifier hs-var">decls'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-862"></span><span>
</span><span id="line-863"></span><span>
</span><span id="line-864"></span><span class="hs-comment">-- | Build the SRT for a strongly-connected component of blocks</span><span>
</span><span id="line-865"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#doSCC"><span class="hs-identifier hs-type">doSCC</span></a></span><span>
</span><span id="line-866"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-867"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-comment">-- which blocks are static function entry points</span><span>
</span><span id="line-868"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-comment">-- static data</span><span>
</span><span id="line-869"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-870"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">StateT</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span>
</span><span id="line-871"></span><span>        </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">]</span><span>          </span><span class="hs-comment">-- generated SRTs</span><span>
</span><span id="line-872"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- SRT fields for info tables</span><span>
</span><span id="line-873"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- SRTs to attach to static functions</span><span>
</span><span id="line-874"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                   </span><span class="hs-comment">-- Whether the group has CAF references</span><span>
</span><span id="line-875"></span><span>        </span><span class="hs-special">)</span><span>
</span><span id="line-876"></span><span>
</span><span id="line-877"></span><span id="doSCC"><span class="annot"><span class="annottext">doSCC :: DynFlags
-&gt; LabelMap CLabel
-&gt; Set CLabel
-&gt; SCC (SomeLabel, CAFLabel, Set CAFLabel)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
</span><a href="GHC.Cmm.Info.Build.html#doSCC"><span class="hs-identifier hs-var hs-var">doSCC</span></a></span></span><span> </span><span id="local-6989586621681055874"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055874"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055873"><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055873"><span class="hs-identifier hs-var">staticFuns</span></a></span></span><span> </span><span id="local-6989586621681055872"><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055872"><span class="hs-identifier hs-var">static_data</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055870"><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055870"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055869"><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055869"><span class="hs-identifier hs-var">cafLbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055868"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055868"><span class="hs-identifier hs-var">cafs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-878"></span><span>  </span><span class="annot"><span class="annottext">DynFlags
-&gt; LabelMap CLabel
-&gt; [SomeLabel]
-&gt; [CAFLabel]
-&gt; Bool
-&gt; Set CAFLabel
-&gt; Set CLabel
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
</span><a href="GHC.Cmm.Info.Build.html#oneSRT"><span class="hs-identifier hs-var">oneSRT</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055874"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055873"><span class="hs-identifier hs-var">staticFuns</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SomeLabel
</span><a href="#local-6989586621681055870"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055869"><span class="hs-identifier hs-var">cafLbl</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055868"><span class="hs-identifier hs-var">cafs</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055872"><span class="hs-identifier hs-var">static_data</span></a></span><span>
</span><span id="line-879"></span><span>
</span><span id="line-880"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#doSCC"><span class="hs-identifier hs-var">doSCC</span></a></span><span> </span><span id="local-6989586621681055867"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055867"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055866"><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055866"><span class="hs-identifier hs-var">staticFuns</span></a></span></span><span> </span><span id="local-6989586621681055865"><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055865"><span class="hs-identifier hs-var">static_data</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span id="local-6989586621681055863"><span class="annot"><span class="annottext">[(SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055863"><span class="hs-identifier hs-var">nodes</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-881"></span><span>  </span><span class="hs-comment">-- build a single SRT for the whole cycle, see Note [recursive SRTs]</span><span>
</span><span id="line-882"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055862"><span class="annot"><span class="annottext">[SomeLabel]
</span><a href="#local-6989586621681055862"><span class="hs-identifier hs-var">lbls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055861"><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055861"><span class="hs-identifier hs-var">caf_lbls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055860"><span class="annot"><span class="annottext">[Set CAFLabel]
</span><a href="#local-6989586621681055860"><span class="hs-identifier hs-var">cafsets</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(SomeLabel, CAFLabel, Set CAFLabel)]
-&gt; ([SomeLabel], [CAFLabel], [Set CAFLabel])
forall a b c. [(a, b, c)] -&gt; ([a], [b], [c])
</span><a href="../../base/src/GHC.List.html#unzip3"><span class="hs-identifier hs-var">unzip3</span></a></span><span> </span><span class="annot"><span class="annottext">[(SomeLabel, CAFLabel, Set CAFLabel)]
</span><a href="#local-6989586621681055863"><span class="hs-identifier hs-var">nodes</span></a></span><span>
</span><span id="line-883"></span><span>      </span><span id="local-6989586621681055858"><span class="annot"><span class="annottext">cafs :: Set CAFLabel
</span><a href="#local-6989586621681055858"><span class="hs-identifier hs-var hs-var">cafs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Set CAFLabel] -&gt; Set CAFLabel
forall (f :: * -&gt; *) a. (Foldable f, Ord a) =&gt; f (Set a) -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#unions"><span class="hs-identifier hs-var">Set.unions</span></a></span><span> </span><span class="annot"><span class="annottext">[Set CAFLabel]
</span><a href="#local-6989586621681055860"><span class="hs-identifier hs-var">cafsets</span></a></span><span>
</span><span id="line-884"></span><span>  </span><span class="annot"><span class="annottext">DynFlags
-&gt; LabelMap CLabel
-&gt; [SomeLabel]
-&gt; [CAFLabel]
-&gt; Bool
-&gt; Set CAFLabel
-&gt; Set CLabel
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
</span><a href="GHC.Cmm.Info.Build.html#oneSRT"><span class="hs-identifier hs-var">oneSRT</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055867"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055866"><span class="hs-identifier hs-var">staticFuns</span></a></span><span> </span><span class="annot"><span class="annottext">[SomeLabel]
</span><a href="#local-6989586621681055862"><span class="hs-identifier hs-var">lbls</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055861"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055858"><span class="hs-identifier hs-var">cafs</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055865"><span class="hs-identifier hs-var">static_data</span></a></span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span>
</span><span id="line-887"></span><span class="hs-comment">{- Note [recursive SRTs]

If the dependency analyser has found us a recursive group of
declarations, then we build a single SRT for the whole group, on the
grounds that everything in the group is reachable from everything
else, so we lose nothing by having a single SRT.

However, there are a couple of wrinkles to be aware of.

* The Set CAFLabel for this SRT will contain labels in the group
itself. The SRTMap will therefore not contain entries for these labels
yet, so we can't turn them into SRTEntries using resolveCAF. BUT we
can just remove recursive references from the Set CAFLabel before
generating the SRT - the SRT will still contain all the CAFLabels that
we need to refer to from this group's SRT.

* That is, EXCEPT for static function closures. For the same reason
described in Note [Invalid optimisation: shortcutting], we cannot omit
references to static function closures.
  - But, since we will merge the SRT with one of the static function
    closures (see [FUN]), we can omit references to *that* static
    function closure from the SRT.
-}</span><span>
</span><span id="line-910"></span><span>
</span><span id="line-911"></span><span class="hs-comment">-- | Build an SRT for a set of blocks</span><span>
</span><span id="line-912"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#oneSRT"><span class="hs-identifier hs-type">oneSRT</span></a></span><span>
</span><span id="line-913"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-914"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>            </span><span class="hs-comment">-- which blocks are static function entry points</span><span>
</span><span id="line-915"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SomeLabel"><span class="hs-identifier hs-type">SomeLabel</span></a></span><span class="hs-special">]</span><span>                </span><span class="hs-comment">-- blocks in this set</span><span>
</span><span id="line-916"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- labels for those blocks</span><span>
</span><span id="line-917"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                       </span><span class="hs-comment">-- True &lt;=&gt; this SRT is for a CAF</span><span>
</span><span id="line-918"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span>               </span><span class="hs-comment">-- SRT for this set</span><span>
</span><span id="line-919"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>                 </span><span class="hs-comment">-- Static data labels in this group</span><span>
</span><span id="line-920"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">StateT</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span>
</span><span id="line-921"></span><span>       </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">]</span><span>                </span><span class="hs-comment">-- SRT objects we built</span><span>
</span><span id="line-922"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>            </span><span class="hs-comment">-- SRT fields for these blocks' itbls</span><span>
</span><span id="line-923"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- SRTs to attach to static functions</span><span>
</span><span id="line-924"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                         </span><span class="hs-comment">-- Whether the group has CAF references</span><span>
</span><span id="line-925"></span><span>       </span><span class="hs-special">)</span><span>
</span><span id="line-926"></span><span>
</span><span id="line-927"></span><span id="oneSRT"><span class="annot"><span class="annottext">oneSRT :: DynFlags
-&gt; LabelMap CLabel
-&gt; [SomeLabel]
-&gt; [CAFLabel]
-&gt; Bool
-&gt; Set CAFLabel
-&gt; Set CLabel
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
</span><a href="GHC.Cmm.Info.Build.html#oneSRT"><span class="hs-identifier hs-var hs-var">oneSRT</span></a></span></span><span> </span><span id="local-6989586621681055856"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055856"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055855"><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055855"><span class="hs-identifier hs-var">staticFuns</span></a></span></span><span> </span><span id="local-6989586621681055854"><span class="annot"><span class="annottext">[SomeLabel]
</span><a href="#local-6989586621681055854"><span class="hs-identifier hs-var">lbls</span></a></span></span><span> </span><span id="local-6989586621681055853"><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span></span><span> </span><span id="local-6989586621681055852"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055852"><span class="hs-identifier hs-var">isCAF</span></a></span></span><span> </span><span id="local-6989586621681055851"><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055851"><span class="hs-identifier hs-var">cafs</span></a></span></span><span> </span><span id="local-6989586621681055850"><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055850"><span class="hs-identifier hs-var">static_data</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-928"></span><span>  </span><span id="local-6989586621681055849"><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">StateT ModuleSRTInfo UniqSM ModuleSRTInfo
forall (m :: * -&gt; *) s. Monad m =&gt; StateT s m s
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-929"></span><span>
</span><span id="line-930"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-931"></span><span>    </span><span id="local-6989586621681055847"><span class="annot"><span class="annottext">config :: NCGConfig
</span><a href="#local-6989586621681055847"><span class="hs-identifier hs-var hs-var">config</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; NCGConfig
</span><a href="GHC.CmmToAsm.Monad.html#initConfig"><span class="hs-identifier hs-var">initConfig</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055856"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-932"></span><span>    </span><span id="local-6989586621681055845"><span class="annot"><span class="annottext">srtMap :: SRTMap
</span><a href="#local-6989586621681055845"><span class="hs-identifier hs-var hs-var">srtMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var hs-var">moduleSRTMap</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span>    </span><span id="local-6989586621681055844"><span class="annot"><span class="annottext">blockids :: [BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var hs-var">blockids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SomeLabel] -&gt; [BlockId]
</span><a href="GHC.Cmm.Info.Build.html#getBlockLabels"><span class="hs-identifier hs-var">getBlockLabels</span></a></span><span> </span><span class="annot"><span class="annottext">[SomeLabel]
</span><a href="#local-6989586621681055854"><span class="hs-identifier hs-var">lbls</span></a></span><span>
</span><span id="line-935"></span><span>
</span><span id="line-936"></span><span>    </span><span class="hs-comment">-- Can we merge this SRT with a FUN_STATIC closure?</span><span>
</span><span id="line-937"></span><span>    </span><span class="annot"><a href="#local-6989586621681055843"><span class="hs-identifier hs-type">maybeFunClosure</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-938"></span><span>    </span><span class="annot"><a href="#local-6989586621681055842"><span class="hs-identifier hs-type">otherFunLabels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-939"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681055843"><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="#local-6989586621681055843"><span class="hs-identifier hs-var">maybeFunClosure</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055842"><span class="annot"><span class="annottext">[CLabel]
</span><a href="#local-6989586621681055842"><span class="hs-identifier hs-var">otherFunLabels</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-940"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055841"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055840"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681055840"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055840"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var">blockids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055841"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055841"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CLabel -&gt; Maybe CLabel
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681055840"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055855"><span class="hs-identifier hs-var">staticFuns</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-941"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-942"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681055839"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055839"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055838"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055838"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681055837"><span class="annot"><span class="annottext">[(CLabel, BlockId)]
</span><a href="#local-6989586621681055837"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CLabel, BlockId) -&gt; Maybe (CLabel, BlockId)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055839"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055838"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">((CLabel, BlockId) -&gt; CLabel) -&gt; [(CLabel, BlockId)] -&gt; [CLabel]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(CLabel, BlockId) -&gt; CLabel
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(CLabel, BlockId)]
</span><a href="#local-6989586621681055837"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-943"></span><span>
</span><span id="line-944"></span><span>    </span><span class="hs-comment">-- Remove recursive references from the SRT</span><span>
</span><span id="line-945"></span><span>    </span><span class="annot"><a href="#local-6989586621681055836"><span class="hs-identifier hs-type">nonRec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span>
</span><span id="line-946"></span><span>    </span><span id="local-6989586621681055836"><span class="annot"><span class="annottext">nonRec :: Set CAFLabel
</span><a href="#local-6989586621681055836"><span class="hs-identifier hs-var hs-var">nonRec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055851"><span class="hs-identifier hs-var">cafs</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; Set CAFLabel -&gt; Set CAFLabel
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#difference"><span class="hs-operator hs-var">`Set.difference`</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel] -&gt; Set CAFLabel
forall a. Ord a =&gt; [a] -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#fromList"><span class="hs-identifier hs-var">Set.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span>
</span><span id="line-947"></span><span>
</span><span id="line-948"></span><span>    </span><span class="hs-comment">-- Resolve references to their SRT entries</span><span>
</span><span id="line-949"></span><span>    </span><span class="annot"><a href="#local-6989586621681055833"><span class="hs-identifier hs-type">resolved</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-950"></span><span>    </span><span id="local-6989586621681055833"><span class="annot"><span class="annottext">resolved :: [SRTEntry]
</span><a href="#local-6989586621681055833"><span class="hs-identifier hs-var hs-var">resolved</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CAFLabel -&gt; Maybe SRTEntry) -&gt; [CAFLabel] -&gt; [SRTEntry]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTMap -&gt; CAFLabel -&gt; Maybe SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#resolveCAF"><span class="hs-identifier hs-var">resolveCAF</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055845"><span class="hs-identifier hs-var">srtMap</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CAFLabel -&gt; [CAFLabel]
forall a. Set a -&gt; [a]
</span><a href="../../containers/src/Data.Set.Internal.html#toList"><span class="hs-identifier hs-var">Set.toList</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055836"><span class="hs-identifier hs-var">nonRec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-951"></span><span>
</span><span id="line-952"></span><span>    </span><span class="hs-comment">-- The set of all SRTEntries in SRTs that we refer to from here.</span><span>
</span><span id="line-953"></span><span>    </span><span id="local-6989586621681055832"><span class="annot"><span class="annottext">allBelow :: Set SRTEntry
</span><a href="#local-6989586621681055832"><span class="hs-identifier hs-var hs-var">allBelow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-954"></span><span>      </span><span class="annot"><span class="annottext">[Set SRTEntry] -&gt; Set SRTEntry
forall (f :: * -&gt; *) a. (Foldable f, Ord a) =&gt; f (Set a) -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#unions"><span class="hs-identifier hs-var">Set.unions</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055831"><span class="hs-identifier hs-var">lbls</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681055830"><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055830"><span class="hs-identifier hs-var">caf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055833"><span class="hs-identifier hs-var">resolved</span></a></span><span>
</span><span id="line-955"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055831"><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055831"><span class="hs-identifier hs-var">lbls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SRTEntry -&gt; Map SRTEntry (Set SRTEntry) -&gt; Maybe (Set SRTEntry)
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055830"><span class="hs-identifier hs-var">caf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Map SRTEntry (Set SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#flatSRTs"><span class="hs-identifier hs-var hs-var">flatSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-956"></span><span>
</span><span id="line-957"></span><span>    </span><span class="hs-comment">-- Remove SRTEntries that are also in an SRT that we refer to.</span><span>
</span><span id="line-958"></span><span>    </span><span class="hs-comment">-- Implements the [Filter] optimisation.</span><span>
</span><span id="line-959"></span><span>    </span><span id="local-6989586621681055829"><span class="annot"><span class="annottext">filtered0 :: Set SRTEntry
</span><a href="#local-6989586621681055829"><span class="hs-identifier hs-var hs-var">filtered0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SRTEntry] -&gt; Set SRTEntry
forall a. Ord a =&gt; [a] -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#fromList"><span class="hs-identifier hs-var">Set.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055833"><span class="hs-identifier hs-var">resolved</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; Set SRTEntry -&gt; Set SRTEntry
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#difference"><span class="hs-operator hs-var">`Set.difference`</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055832"><span class="hs-identifier hs-var">allBelow</span></a></span><span>
</span><span id="line-960"></span><span>
</span><span id="line-961"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT:&quot;</span></span><span>
</span><span id="line-962"></span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;srtMap:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055845"><span class="hs-identifier hs-var">srtMap</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-963"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;nonRec:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055836"><span class="hs-identifier hs-var">nonRec</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-964"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lbls:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SomeLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[SomeLabel]
</span><a href="#local-6989586621681055854"><span class="hs-identifier hs-var">lbls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-965"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;caf_lbls:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-966"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;static_data:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055850"><span class="hs-identifier hs-var">static_data</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-967"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cafs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set CAFLabel
</span><a href="#local-6989586621681055851"><span class="hs-identifier hs-var">cafs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-968"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;blockids:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[BlockId] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var">blockids</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-969"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maybeFunClosure:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="#local-6989586621681055843"><span class="hs-identifier hs-var">maybeFunClosure</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-970"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;otherFunLabels:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[CLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CLabel]
</span><a href="#local-6989586621681055842"><span class="hs-identifier hs-var">otherFunLabels</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-971"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;resolved:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055833"><span class="hs-identifier hs-var">resolved</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-972"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;allBelow:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055832"><span class="hs-identifier hs-var">allBelow</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-973"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;filtered0:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055829"><span class="hs-identifier hs-var">filtered0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-974"></span><span>
</span><span id="line-975"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-976"></span><span>    </span><span id="local-6989586621681055828"><span class="annot"><span class="annottext">isStaticFun :: Bool
</span><a href="#local-6989586621681055828"><span class="hs-identifier hs-var hs-var">isStaticFun</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId) -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="#local-6989586621681055843"><span class="hs-identifier hs-var">maybeFunClosure</span></a></span><span>
</span><span id="line-977"></span><span>
</span><span id="line-978"></span><span>    </span><span class="hs-comment">-- For a label without a closure (e.g. a continuation), we must</span><span>
</span><span id="line-979"></span><span>    </span><span class="hs-comment">-- update the SRTMap for the label to point to a closure. It's</span><span>
</span><span id="line-980"></span><span>    </span><span class="hs-comment">-- important that we don't do this for static functions or CAFs,</span><span>
</span><span id="line-981"></span><span>    </span><span class="hs-comment">-- see Note [Invalid optimisation: shortcutting].</span><span>
</span><span id="line-982"></span><span>    </span><span class="annot"><a href="#local-6989586621681055826"><span class="hs-identifier hs-type">updateSRTMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">StateT</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#ModuleSRTInfo"><span class="hs-identifier hs-type">ModuleSRTInfo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-983"></span><span>    </span><span id="local-6989586621681055826"><span class="annot"><span class="annottext">updateSRTMap :: Maybe SRTEntry -&gt; StateT ModuleSRTInfo UniqSM ()
</span><a href="#local-6989586621681055826"><span class="hs-identifier hs-var hs-var">updateSRTMap</span></a></span></span><span> </span><span id="local-6989586621681055825"><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055825"><span class="hs-identifier hs-var">srtEntry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-984"></span><span>      </span><span class="annot"><span class="annottext">String
-&gt; SDoc
-&gt; StateT ModuleSRTInfo UniqSM ()
-&gt; StateT ModuleSRTInfo UniqSM ()
forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var">srtTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;updateSRTMap&quot;</span></span><span>
</span><span id="line-985"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055825"><span class="hs-identifier hs-var">srtEntry</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;isCAF:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055852"><span class="hs-identifier hs-var">isCAF</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-986"></span><span>         </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;isStaticFun:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055828"><span class="hs-identifier hs-var">isStaticFun</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(StateT ModuleSRTInfo UniqSM () -&gt; StateT ModuleSRTInfo UniqSM ())
-&gt; StateT ModuleSRTInfo UniqSM () -&gt; StateT ModuleSRTInfo UniqSM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-987"></span><span>      </span><span class="annot"><span class="annottext">Bool
-&gt; StateT ModuleSRTInfo UniqSM () -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055852"><span class="hs-identifier hs-var">isCAF</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055828"><span class="hs-identifier hs-var">isStaticFun</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isNothing"><span class="hs-identifier hs-var">isNothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055825"><span class="hs-identifier hs-var">srtEntry</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(StateT ModuleSRTInfo UniqSM () -&gt; StateT ModuleSRTInfo UniqSM ())
-&gt; StateT ModuleSRTInfo UniqSM () -&gt; StateT ModuleSRTInfo UniqSM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-988"></span><span>        </span><span class="annot"><span class="annottext">(ModuleSRTInfo -&gt; ModuleSRTInfo) -&gt; StateT ModuleSRTInfo UniqSM ()
forall (m :: * -&gt; *) s. Monad m =&gt; (s -&gt; s) -&gt; StateT s m ()
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#modify%27"><span class="hs-identifier hs-var">modify'</span></a></span><span> </span><span class="annot"><span class="annottext">((ModuleSRTInfo -&gt; ModuleSRTInfo)
 -&gt; StateT ModuleSRTInfo UniqSM ())
-&gt; (ModuleSRTInfo -&gt; ModuleSRTInfo)
-&gt; StateT ModuleSRTInfo UniqSM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681055821"><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055821"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-989"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681055820"><span class="annot"><span class="annottext">srt_map :: SRTMap
</span><a href="#local-6989586621681055820"><span class="hs-identifier hs-var hs-var">srt_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-990"></span><span>                 </span><span class="annot"><span class="annottext">(SRTMap -&gt; CAFLabel -&gt; SRTMap) -&gt; SRTMap -&gt; [CAFLabel] -&gt; SRTMap
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681055819"><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055819"><span class="hs-identifier hs-var">srt_map</span></a></span></span><span> </span><span id="local-6989586621681055818"><span class="annot"><span class="annottext">cafLbl :: CAFLabel
</span><a href="#local-6989586621681055818"><span class="hs-identifier hs-var">cafLbl</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span id="local-6989586621681055817"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055817"><span class="hs-identifier hs-var">clbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-991"></span><span>                          </span><span class="hs-comment">-- Only map static data to Nothing (== not CAFFY). For CAFFY</span><span>
</span><span id="line-992"></span><span>                          </span><span class="hs-comment">-- statics we refer to the static itself instead of a SRT.</span><span>
</span><span id="line-993"></span><span>                          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; Set CLabel -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#member"><span class="hs-identifier hs-var">Set.member</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055817"><span class="hs-identifier hs-var">clbl</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055850"><span class="hs-identifier hs-var">static_data</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isNothing"><span class="hs-identifier hs-var">isNothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055825"><span class="hs-identifier hs-var">srtEntry</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-994"></span><span>                            </span><span class="annot"><span class="annottext">CAFLabel -&gt; Maybe SRTEntry -&gt; SRTMap -&gt; SRTMap
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">CAFLabel
</span><a href="#local-6989586621681055818"><span class="hs-identifier hs-var">cafLbl</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="#local-6989586621681055825"><span class="hs-identifier hs-var">srtEntry</span></a></span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055819"><span class="hs-identifier hs-var">srt_map</span></a></span><span>
</span><span id="line-995"></span><span>                          </span><span class="hs-keyword">else</span><span>
</span><span id="line-996"></span><span>                            </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055819"><span class="hs-identifier hs-var">srt_map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-997"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var hs-var">moduleSRTMap</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055821"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-998"></span><span>                        </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span>
</span><span id="line-999"></span><span>           </span><span class="hs-keyword">in</span><span>
</span><span id="line-1000"></span><span>               </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055821"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">moduleSRTMap :: SRTMap
</span><a href="GHC.Cmm.Info.Build.html#moduleSRTMap"><span class="hs-identifier hs-var">moduleSRTMap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SRTMap
</span><a href="#local-6989586621681055820"><span class="hs-identifier hs-var">srt_map</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1001"></span><span>
</span><span id="line-1002"></span><span>    </span><span id="local-6989586621681055815"><span class="annot"><span class="annottext">this_mod :: Module
</span><a href="#local-6989586621681055815"><span class="hs-identifier hs-var hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Module
</span><a href="GHC.Cmm.Info.Build.html#thisModule"><span class="hs-identifier hs-var hs-var">thisModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span><span>
</span><span id="line-1003"></span><span>
</span><span id="line-1004"></span><span>    </span><span id="local-6989586621681055814"><span class="annot"><span class="annottext">allStaticData :: Bool
</span><a href="#local-6989586621681055814"><span class="hs-identifier hs-var hs-var">allStaticData</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1005"></span><span>      </span><span class="annot"><span class="annottext">(CAFLabel -&gt; Bool) -&gt; [CAFLabel] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#CAFLabel"><span class="hs-identifier hs-type">CAFLabel</span></a></span><span> </span><span id="local-6989586621681055812"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055812"><span class="hs-identifier hs-var">clbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Set CLabel -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#member"><span class="hs-identifier hs-var">Set.member</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055812"><span class="hs-identifier hs-var">clbl</span></a></span><span> </span><span class="annot"><span class="annottext">Set CLabel
</span><a href="#local-6989586621681055850"><span class="hs-identifier hs-var">static_data</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span>
</span><span id="line-1006"></span><span>
</span><span id="line-1007"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; Bool
forall a. Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#null"><span class="hs-identifier hs-var">Set.null</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055829"><span class="hs-identifier hs-var">filtered0</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1008"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT: empty&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CAFLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1009"></span><span>    </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; StateT ModuleSRTInfo UniqSM ()
</span><a href="#local-6989586621681055826"><span class="hs-identifier hs-var">updateSRTMap</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SRTEntry
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1010"></span><span>    </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-1011"></span><span>  </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1012"></span><span>    </span><span class="hs-comment">-- We're going to build an SRT for this group, which should include function</span><span>
</span><span id="line-1013"></span><span>    </span><span class="hs-comment">-- references in the group. See Note [recursive SRTs].</span><span>
</span><span id="line-1014"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055809"><span class="annot"><span class="annottext">allBelow_funs :: Set SRTEntry
</span><a href="#local-6989586621681055809"><span class="hs-identifier hs-var hs-var">allBelow_funs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1015"></span><span>          </span><span class="annot"><span class="annottext">[SRTEntry] -&gt; Set SRTEntry
forall a. Ord a =&gt; [a] -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#fromList"><span class="hs-identifier hs-var">Set.fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CLabel -&gt; SRTEntry) -&gt; [CLabel] -&gt; [SRTEntry]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-var">SRTEntry</span></a></span><span> </span><span class="annot"><span class="annottext">(CLabel -&gt; SRTEntry) -&gt; (CLabel -&gt; CLabel) -&gt; CLabel -&gt; SRTEntry
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#toClosureLbl"><span class="hs-identifier hs-var">toClosureLbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CLabel]
</span><a href="#local-6989586621681055842"><span class="hs-identifier hs-var">otherFunLabels</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1016"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055807"><span class="annot"><span class="annottext">filtered :: Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var hs-var">filtered</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055829"><span class="hs-identifier hs-var">filtered0</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; Set SRTEntry -&gt; Set SRTEntry
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#union"><span class="hs-operator hs-var">`Set.union`</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055809"><span class="hs-identifier hs-var">allBelow_funs</span></a></span><span>
</span><span id="line-1017"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;filtered:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var">filtered</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1018"></span><span>                        </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;allBelow_funs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055809"><span class="hs-identifier hs-var">allBelow_funs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1019"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; [SRTEntry]
forall a. Set a -&gt; [a]
</span><a href="../../containers/src/Data.Set.Internal.html#toList"><span class="hs-identifier hs-var">Set.toList</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var">filtered</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1020"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
-&gt; SDoc
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="hs-comment">-- unreachable</span><span>
</span><span id="line-1021"></span><span>
</span><span id="line-1022"></span><span>      </span><span class="hs-comment">-- [Inline] - when we have only one entry there is no need to</span><span>
</span><span id="line-1023"></span><span>      </span><span class="hs-comment">-- build an SRT object at all, instead we put the singleton SRT</span><span>
</span><span id="line-1024"></span><span>      </span><span class="hs-comment">-- entry in the info table.</span><span>
</span><span id="line-1025"></span><span>      </span><span class="hs-special">[</span><span id="local-6989586621681055805"><span class="annot"><span class="annottext">one :: SRTEntry
</span><a href="#local-6989586621681055805"><span class="hs-identifier hs-var">one</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span id="local-6989586621681055804"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055804"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1026"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="hs-comment">-- Info tables refer to SRTs by offset (as noted in the section</span><span>
</span><span id="line-1027"></span><span>          </span><span class="hs-comment">-- &quot;Referring to an SRT from the info table&quot; of Note [SRTs]). However,</span><span>
</span><span id="line-1028"></span><span>          </span><span class="hs-comment">-- when dynamic linking is used we cannot guarantee that the offset</span><span>
</span><span id="line-1029"></span><span>          </span><span class="hs-comment">-- between the SRT and the info table will fit in the offset field.</span><span>
</span><span id="line-1030"></span><span>          </span><span class="hs-comment">-- Consequently we build a singleton SRT in this case.</span><span>
</span><span id="line-1031"></span><span>          </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NCGConfig -&gt; Module -&gt; CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#labelDynamic"><span class="hs-identifier hs-var">labelDynamic</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681055847"><span class="hs-identifier hs-var">config</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681055815"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055804"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1032"></span><span>
</span><span id="line-1033"></span><span>          </span><span class="hs-comment">-- MachO relocations can't express offsets between compilation units at</span><span>
</span><span id="line-1034"></span><span>          </span><span class="hs-comment">-- all, so we are always forced to build a singleton SRT in this case.</span><span>
</span><span id="line-1035"></span><span>            </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OS -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#osMachOTarget"><span class="hs-identifier hs-var">osMachOTarget</span></a></span><span> </span><span class="annot"><span class="annottext">(OS -&gt; Bool) -&gt; OS -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">(Platform -&gt; OS) -&gt; Platform -&gt; OS
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig -&gt; Platform
</span><a href="GHC.CmmToAsm.Config.html#ncgPlatform"><span class="hs-identifier hs-var hs-var">ncgPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681055847"><span class="hs-identifier hs-var">config</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1036"></span><span>               </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Module -&gt; CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#isLocalCLabel"><span class="hs-identifier hs-var">isLocalCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681055815"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055804"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1037"></span><span>
</span><span id="line-1038"></span><span>          </span><span class="hs-comment">-- If we have a static function closure, then it becomes the</span><span>
</span><span id="line-1039"></span><span>          </span><span class="hs-comment">-- SRT object, and everything else points to it. (the only way</span><span>
</span><span id="line-1040"></span><span>          </span><span class="hs-comment">-- we could have multiple labels here is if this is a</span><span>
</span><span id="line-1041"></span><span>          </span><span class="hs-comment">-- recursive group, see Note [recursive SRTs])</span><span>
</span><span id="line-1042"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="#local-6989586621681055843"><span class="hs-identifier hs-var">maybeFunClosure</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1043"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055798"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055798"><span class="hs-identifier hs-var">staticFunLbl</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055797"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055797"><span class="hs-identifier hs-var">staticFunBlock</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1044"></span><span>                </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681055796"><span class="hs-identifier hs-var">withLabels</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-1045"></span><span>              </span><span class="hs-keyword">where</span><span>
</span><span id="line-1046"></span><span>                </span><span id="local-6989586621681055796"><span class="annot"><span class="annottext">withLabels :: [(BlockId, CLabel)]
</span><a href="#local-6989586621681055796"><span class="hs-identifier hs-var hs-var">withLabels</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1047"></span><span>                  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055795"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055795"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055797"><span class="hs-identifier hs-var">staticFunBlock</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055804"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055798"><span class="hs-identifier hs-var">staticFunLbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1048"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681055795"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055795"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var">blockids</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1049"></span><span>            </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1050"></span><span>              </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT: one&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;caf_lbls:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1051"></span><span>                                       </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;one:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055805"><span class="hs-identifier hs-var">one</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1052"></span><span>              </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; StateT ModuleSRTInfo UniqSM ()
</span><a href="#local-6989586621681055826"><span class="hs-identifier hs-var">updateSRTMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTEntry -&gt; Maybe SRTEntry
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055805"><span class="hs-identifier hs-var">one</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1053"></span><span>              </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; (BlockId, CLabel)) -&gt; [BlockId] -&gt; [(BlockId, CLabel)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055804"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var">blockids</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-1054"></span><span>
</span><span id="line-1055"></span><span>      </span><span id="local-6989586621681055794"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055794"><span class="hs-identifier hs-var">cafList</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055814"><span class="hs-identifier hs-var">allStaticData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1056"></span><span>        </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SRTEntry] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055794"><span class="hs-identifier hs-var">cafList</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1057"></span><span>
</span><span id="line-1058"></span><span>      </span><span id="local-6989586621681055792"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055792"><span class="hs-identifier hs-var">cafList</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1059"></span><span>        </span><span class="hs-comment">-- Check whether an SRT with the same entries has been emitted already.</span><span>
</span><span id="line-1060"></span><span>        </span><span class="hs-comment">-- Implements the [Common] optimisation.</span><span>
</span><span id="line-1061"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; Map (Set SRTEntry) SRTEntry -&gt; Maybe SRTEntry
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var">filtered</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Map (Set SRTEntry) SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#dedupSRTs"><span class="hs-identifier hs-var hs-var">dedupSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1062"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055791"><span class="annot"><span class="annottext">srtEntry :: SRTEntry
</span><a href="#local-6989586621681055791"><span class="hs-identifier hs-var">srtEntry</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span id="local-6989586621681055790"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055790"><span class="hs-identifier hs-var">srtLbl</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1063"></span><span>            </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT [Common]&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CAFLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055790"><span class="hs-identifier hs-var">srtLbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1064"></span><span>            </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; StateT ModuleSRTInfo UniqSM ()
</span><a href="#local-6989586621681055826"><span class="hs-identifier hs-var">updateSRTMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTEntry -&gt; Maybe SRTEntry
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055791"><span class="hs-identifier hs-var">srtEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1065"></span><span>            </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; (BlockId, CLabel)) -&gt; [BlockId] -&gt; [(BlockId, CLabel)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055790"><span class="hs-identifier hs-var">srtLbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var">blockids</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-1066"></span><span>          </span><span class="annot"><span class="annottext">Maybe SRTEntry
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1067"></span><span>            </span><span class="hs-comment">-- No duplicates: we have to build a new SRT object</span><span>
</span><span id="line-1068"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681055789"><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055789"><span class="hs-identifier hs-var">decls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055788"><span class="annot"><span class="annottext">[(BlockId, [SRTEntry])]
</span><a href="#local-6989586621681055788"><span class="hs-identifier hs-var">funSRTs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055787"><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055787"><span class="hs-identifier hs-var">srtEntry</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-1069"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="#local-6989586621681055843"><span class="hs-identifier hs-var">maybeFunClosure</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1070"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055786"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055786"><span class="hs-identifier hs-var">fun</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055785"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055785"><span class="hs-identifier hs-var">block</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1071"></span><span>                  </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, [SRTEntry])], SRTEntry)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, [SRTEntry])], SRTEntry)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055785"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055792"><span class="hs-identifier hs-var">cafList</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-var">SRTEntry</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055786"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1072"></span><span>                </span><span class="annot"><span class="annottext">Maybe (CLabel, BlockId)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1073"></span><span>                  </span><span class="hs-special">(</span><span id="local-6989586621681055784"><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055784"><span class="hs-identifier hs-var">decls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055783"><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055783"><span class="hs-identifier hs-var">entry</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqSM ([CmmDeclSRTs], SRTEntry)
-&gt; StateT ModuleSRTInfo UniqSM ([CmmDeclSRTs], SRTEntry)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqSM ([CmmDeclSRTs], SRTEntry)
 -&gt; StateT ModuleSRTInfo UniqSM ([CmmDeclSRTs], SRTEntry))
-&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
-&gt; StateT ModuleSRTInfo UniqSM ([CmmDeclSRTs], SRTEntry)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [SRTEntry] -&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#buildSRTChain"><span class="hs-identifier hs-var">buildSRTChain</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055856"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055792"><span class="hs-identifier hs-var">cafList</span></a></span><span>
</span><span id="line-1074"></span><span>                  </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, [SRTEntry])], SRTEntry)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, [SRTEntry])], SRTEntry)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055784"><span class="hs-identifier hs-var">decls</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055783"><span class="hs-identifier hs-var">entry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1075"></span><span>            </span><span class="annot"><span class="annottext">Maybe SRTEntry -&gt; StateT ModuleSRTInfo UniqSM ()
</span><a href="#local-6989586621681055826"><span class="hs-identifier hs-var">updateSRTMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTEntry -&gt; Maybe SRTEntry
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055787"><span class="hs-identifier hs-var">srtEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1076"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681055780"><span class="annot"><span class="annottext">allBelowThis :: Set SRTEntry
</span><a href="#local-6989586621681055780"><span class="hs-identifier hs-var hs-var">allBelowThis</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; Set SRTEntry -&gt; Set SRTEntry
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#union"><span class="hs-identifier hs-var">Set.union</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055832"><span class="hs-identifier hs-var">allBelow</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var">filtered</span></a></span><span>
</span><span id="line-1077"></span><span>                </span><span id="local-6989586621681055779"><span class="annot"><span class="annottext">newFlatSRTs :: Map SRTEntry (Set SRTEntry)
</span><a href="#local-6989586621681055779"><span class="hs-identifier hs-var hs-var">newFlatSRTs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SRTEntry
-&gt; Set SRTEntry
-&gt; Map SRTEntry (Set SRTEntry)
-&gt; Map SRTEntry (Set SRTEntry)
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055787"><span class="hs-identifier hs-var">srtEntry</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055780"><span class="hs-identifier hs-var">allBelowThis</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Map SRTEntry (Set SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#flatSRTs"><span class="hs-identifier hs-var hs-var">flatSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1078"></span><span>                </span><span class="hs-comment">-- When all definition in this group are static data we don't</span><span>
</span><span id="line-1079"></span><span>                </span><span class="hs-comment">-- generate any SRTs.</span><span>
</span><span id="line-1080"></span><span>                </span><span id="local-6989586621681055778"><span class="annot"><span class="annottext">newDedupSRTs :: Map (Set SRTEntry) SRTEntry
</span><a href="#local-6989586621681055778"><span class="hs-identifier hs-var hs-var">newDedupSRTs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
-&gt; SRTEntry
-&gt; Map (Set SRTEntry) SRTEntry
-&gt; Map (Set SRTEntry) SRTEntry
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var">filtered</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055787"><span class="hs-identifier hs-var">srtEntry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleSRTInfo -&gt; Map (Set SRTEntry) SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#dedupSRTs"><span class="hs-identifier hs-var hs-var">dedupSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055849"><span class="hs-identifier hs-var">topSRT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1081"></span><span>            </span><span class="annot"><span class="annottext">(ModuleSRTInfo -&gt; ModuleSRTInfo) -&gt; StateT ModuleSRTInfo UniqSM ()
forall (m :: * -&gt; *) s. Monad m =&gt; (s -&gt; s) -&gt; StateT s m ()
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#modify%27"><span class="hs-identifier hs-var">modify'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681055777"><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055777"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModuleSRTInfo
</span><a href="#local-6989586621681055777"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">dedupSRTs :: Map (Set SRTEntry) SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#dedupSRTs"><span class="hs-identifier hs-var">dedupSRTs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry
</span><a href="#local-6989586621681055778"><span class="hs-identifier hs-var">newDedupSRTs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1082"></span><span>                                      </span><span class="annot"><span class="annottext">flatSRTs :: Map SRTEntry (Set SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#flatSRTs"><span class="hs-identifier hs-var">flatSRTs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map SRTEntry (Set SRTEntry)
</span><a href="#local-6989586621681055779"><span class="hs-identifier hs-var">newFlatSRTs</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1083"></span><span>            </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StateT ModuleSRTInfo UniqSM ()
forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var">srtTraceM</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneSRT: new&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;caf_lbls:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CAFLabel]
</span><a href="#local-6989586621681055853"><span class="hs-identifier hs-var">caf_lbls</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1084"></span><span>                                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;filtered:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Set SRTEntry
</span><a href="#local-6989586621681055807"><span class="hs-identifier hs-var">filtered</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1085"></span><span>                                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;srtEntry:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055787"><span class="hs-identifier hs-var">srtEntry</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1086"></span><span>                                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newDedupSRTs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Map (Set SRTEntry) SRTEntry
</span><a href="#local-6989586621681055778"><span class="hs-identifier hs-var">newDedupSRTs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1087"></span><span>                                      </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newFlatSRTs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Map SRTEntry (Set SRTEntry) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Map SRTEntry (Set SRTEntry)
</span><a href="#local-6989586621681055779"><span class="hs-identifier hs-var">newFlatSRTs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1088"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span id="local-6989586621681055776"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055776"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055787"><span class="hs-identifier hs-var">srtEntry</span></a></span><span>
</span><span id="line-1089"></span><span>            </span><span class="annot"><span class="annottext">([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
-&gt; StateT
     ModuleSRTInfo
     UniqSM
     ([CmmDeclSRTs], [(BlockId, CLabel)], [(BlockId, [SRTEntry])], Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055789"><span class="hs-identifier hs-var">decls</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; (BlockId, CLabel)) -&gt; [BlockId] -&gt; [(BlockId, CLabel)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055776"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681055844"><span class="hs-identifier hs-var">blockids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(BlockId, [SRTEntry])]
</span><a href="#local-6989586621681055788"><span class="hs-identifier hs-var">funSRTs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-1090"></span><span>
</span><span id="line-1091"></span><span>
</span><span id="line-1092"></span><span class="hs-comment">-- | build a static SRT object (or a chain of objects) from a list of</span><span>
</span><span id="line-1093"></span><span class="hs-comment">-- SRTEntries.</span><span>
</span><span id="line-1094"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#buildSRTChain"><span class="hs-identifier hs-type">buildSRTChain</span></a></span><span>
</span><span id="line-1095"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-1096"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1097"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span>
</span><span id="line-1098"></span><span>        </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- The SRT object(s)</span><span>
</span><span id="line-1099"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span>      </span><span class="hs-comment">-- label to use in the info table</span><span>
</span><span id="line-1100"></span><span>        </span><span class="hs-special">)</span><span>
</span><span id="line-1101"></span><span id="buildSRTChain"><span class="annot"><span class="annottext">buildSRTChain :: DynFlags -&gt; [SRTEntry] -&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#buildSRTChain"><span class="hs-identifier hs-var hs-var">buildSRTChain</span></a></span></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;buildSRT: empty&quot;</span></span><span>
</span><span id="line-1102"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#buildSRTChain"><span class="hs-identifier hs-var">buildSRTChain</span></a></span><span> </span><span id="local-6989586621681055774"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055774"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055773"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055773"><span class="hs-identifier hs-var">cafSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1103"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">WordOff -&gt; [SRTEntry] -&gt; ([SRTEntry], [SRTEntry])
forall a. WordOff -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><a href="#local-6989586621681055771"><span class="hs-identifier hs-var">mAX_SRT_SIZE</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055773"><span class="hs-identifier hs-var">cafSet</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1104"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681055770"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055770"><span class="hs-identifier hs-var">these</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1105"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681055769"><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055769"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055768"><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055768"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [SRTEntry] -&gt; UniqSM (CmmDeclSRTs, SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#buildSRT"><span class="hs-identifier hs-var">buildSRT</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055774"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055770"><span class="hs-identifier hs-var">these</span></a></span><span>
</span><span id="line-1106"></span><span>      </span><span class="annot"><span class="annottext">([CmmDeclSRTs], SRTEntry) -&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055769"><span class="hs-identifier hs-var">decl</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055768"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1107"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681055766"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055766"><span class="hs-identifier hs-var">these</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055765"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055765"><span class="hs-identifier hs-var">those</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1108"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681055764"><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055764"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055763"><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055763"><span class="hs-identifier hs-var">rest_lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [SRTEntry] -&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#buildSRTChain"><span class="hs-identifier hs-var">buildSRTChain</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055774"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SRTEntry] -&gt; SRTEntry
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055766"><span class="hs-identifier hs-var">these</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry -&gt; [SRTEntry] -&gt; [SRTEntry]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055765"><span class="hs-identifier hs-var">those</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1109"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681055761"><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055761"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681055760"><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055760"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [SRTEntry] -&gt; UniqSM (CmmDeclSRTs, SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#buildSRT"><span class="hs-identifier hs-var">buildSRT</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055774"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055763"><span class="hs-identifier hs-var">rest_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">SRTEntry -&gt; [SRTEntry] -&gt; [SRTEntry]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[SRTEntry] -&gt; [SRTEntry]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055766"><span class="hs-identifier hs-var">these</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1110"></span><span>      </span><span class="annot"><span class="annottext">([CmmDeclSRTs], SRTEntry) -&gt; UniqSM ([CmmDeclSRTs], SRTEntry)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055761"><span class="hs-identifier hs-var">decl</span></a></span><span class="annot"><span class="annottext">CmmDeclSRTs -&gt; [CmmDeclSRTs] -&gt; [CmmDeclSRTs]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[CmmDeclSRTs]
</span><a href="#local-6989586621681055764"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SRTEntry
</span><a href="#local-6989586621681055760"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1111"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1112"></span><span>    </span><span id="local-6989586621681055771"><span class="annot"><span class="annottext">mAX_SRT_SIZE :: WordOff
</span><a href="#local-6989586621681055771"><span class="hs-identifier hs-var hs-var">mAX_SRT_SIZE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-number">16</span></span><span>
</span><span id="line-1113"></span><span>
</span><span id="line-1114"></span><span>
</span><span id="line-1115"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#buildSRT"><span class="hs-identifier hs-type">buildSRT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1116"></span><span id="buildSRT"><span class="annot"><span class="annottext">buildSRT :: DynFlags -&gt; [SRTEntry] -&gt; UniqSM (CmmDeclSRTs, SRTEntry)
</span><a href="GHC.Cmm.Info.Build.html#buildSRT"><span class="hs-identifier hs-var hs-var">buildSRT</span></a></span></span><span> </span><span id="local-6989586621681055757"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055757"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055756"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055756"><span class="hs-identifier hs-var">refs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1117"></span><span>  </span><span id="local-6989586621681055755"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681055755"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqSM Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-1118"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-1119"></span><span>    </span><span id="local-6989586621681055753"><span class="annot"><span class="annottext">lbl :: CLabel
</span><a href="#local-6989586621681055753"><span class="hs-identifier hs-var hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkSRTLabel"><span class="hs-identifier hs-var">mkSRTLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681055755"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1120"></span><span>    </span><span id="local-6989586621681055751"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681055751"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055757"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1121"></span><span>    </span><span id="local-6989586621681055749"><span class="annot"><span class="annottext">srt_n_info :: CLabel
</span><a href="#local-6989586621681055749"><span class="hs-identifier hs-var hs-var">srt_n_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WordOff -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkSRTInfoLabel"><span class="hs-identifier hs-var">mkSRTInfoLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SRTEntry] -&gt; WordOff
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; WordOff
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055756"><span class="hs-identifier hs-var">refs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1122"></span><span>    </span><span id="local-6989586621681055746"><span class="annot"><span class="annottext">fields :: [CmmLit]
</span><a href="#local-6989586621681055746"><span class="hs-identifier hs-var hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1123"></span><span>      </span><span class="annot"><span class="annottext">DynFlags
-&gt; CLabel
-&gt; CostCentreStack
-&gt; [CmmLit]
-&gt; [CmmLit]
-&gt; [CmmLit]
-&gt; [CmmLit]
-&gt; [CmmLit]
</span><a href="GHC.StgToCmm.Heap.html#mkStaticClosure"><span class="hs-identifier hs-var">mkStaticClosure</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055757"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055749"><span class="hs-identifier hs-var">srt_n_info</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="GHC.Types.CostCentre.html#dontCareCCS"><span class="hs-identifier hs-var">dontCareCCS</span></a></span><span>
</span><span id="line-1124"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055743"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span id="local-6989586621681055743"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055743"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055756"><span class="hs-identifier hs-var">refs</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1125"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- no padding</span><span>
</span><span id="line-1126"></span><span>        </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Platform -&gt; WordOff -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#mkIntCLit"><span class="hs-identifier hs-var">mkIntCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681055751"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">WordOff
</span><span class="hs-number">0</span></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- link field</span><span>
</span><span id="line-1127"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- no saved info</span><span>
</span><span id="line-1128"></span><span>  </span><span class="annot"><span class="annottext">(CmmDeclSRTs, SRTEntry) -&gt; UniqSM (CmmDeclSRTs, SRTEntry)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Section -&gt; CLabel -&gt; [CmmLit] -&gt; CmmDeclSRTs
forall (raw :: Bool) info stmt.
Section
-&gt; CLabel -&gt; [CmmLit] -&gt; GenCmmDecl (GenCmmStatics raw) info stmt
</span><a href="GHC.Cmm.Utils.html#mkDataLits"><span class="hs-identifier hs-var">mkDataLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SectionType -&gt; CLabel -&gt; Section
</span><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#Data"><span class="hs-identifier hs-var">Data</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055753"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055753"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055746"><span class="hs-identifier hs-var">fields</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SRTEntry
</span><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-var">SRTEntry</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055753"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1129"></span><span>
</span><span id="line-1130"></span><span class="hs-comment">-- | Update info tables with references to their SRTs. Also generate</span><span>
</span><span id="line-1131"></span><span class="hs-comment">-- static closures, splicing in SRT fields as necessary.</span><span>
</span><span id="line-1132"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#updInfoSRTs"><span class="hs-identifier hs-type">updInfoSRTs</span></a></span><span>
</span><span id="line-1133"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-1134"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>               </span><span class="hs-comment">-- SRT labels for each block</span><span>
</span><span id="line-1135"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span class="hs-special">]</span><span>           </span><span class="hs-comment">-- SRTs to merge into FUN_STATIC closures</span><span>
</span><span id="line-1136"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                          </span><span class="hs-comment">-- Whether the CmmDecl's group has CAF references</span><span>
</span><span id="line-1137"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span>
</span><span id="line-1138"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1139"></span><span>
</span><span id="line-1140"></span><span id="updInfoSRTs"><span class="annot"><span class="annottext">updInfoSRTs :: DynFlags
-&gt; LabelMap CLabel
-&gt; LabelMap [SRTEntry]
-&gt; Bool
-&gt; CmmDecl
-&gt; [CmmDeclSRTs]
</span><a href="GHC.Cmm.Info.Build.html#updInfoSRTs"><span class="hs-identifier hs-var hs-var">updInfoSRTs</span></a></span></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LabelMap [SRTEntry]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span id="local-6989586621681055738"><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681055738"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681055737"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055737"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681055736"><span class="annot"><span class="annottext">[CmmStatic]
</span><a href="#local-6989586621681055736"><span class="hs-identifier hs-var">statics</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1141"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Section -&gt; GenCmmStatics 'True -&gt; CmmDeclSRTs
forall d h g. Section -&gt; d -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-var">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681055738"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; [CmmStatic] -&gt; GenCmmStatics 'True
forall (rawOnly :: Bool).
CLabel -&gt; [CmmStatic] -&gt; GenCmmStatics rawOnly
</span><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-var">CmmStaticsRaw</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055737"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmStatic]
</span><a href="#local-6989586621681055736"><span class="hs-identifier hs-var">statics</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1142"></span><span>
</span><span id="line-1143"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#updInfoSRTs"><span class="hs-identifier hs-var">updInfoSRTs</span></a></span><span> </span><span id="local-6989586621681055735"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055735"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LabelMap [SRTEntry]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681055734"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055734"><span class="hs-identifier hs-var">caffy</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span id="local-6989586621681055733"><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681055733"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-type">CmmStatics</span></a></span><span> </span><span id="local-6989586621681055731"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055731"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681055730"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055730"><span class="hs-identifier hs-var">itbl</span></a></span></span><span> </span><span id="local-6989586621681055729"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681055729"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621681055728"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055728"><span class="hs-identifier hs-var">payload</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1144"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Section -&gt; GenCmmStatics 'True -&gt; CmmDeclSRTs
forall d h g. Section -&gt; d -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-var">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681055733"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; [CmmStatic] -&gt; GenCmmStatics 'True
forall (rawOnly :: Bool).
CLabel -&gt; [CmmStatic] -&gt; GenCmmStatics rawOnly
</span><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-var">CmmStaticsRaw</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055731"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CmmLit -&gt; CmmStatic) -&gt; [CmmLit] -&gt; [CmmStatic]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmStatic
</span><a href="GHC.Cmm.html#CmmStaticLit"><span class="hs-identifier hs-var">CmmStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055726"><span class="hs-identifier hs-var">field_lits</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1145"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1146"></span><span>    </span><span id="local-6989586621681055725"><span class="annot"><span class="annottext">caf_info :: CafInfo
</span><a href="#local-6989586621681055725"><span class="hs-identifier hs-var hs-var">caf_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055734"><span class="hs-identifier hs-var">caffy</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#MayHaveCafRefs"><span class="hs-identifier hs-var">MayHaveCafRefs</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#NoCafRefs"><span class="hs-identifier hs-var">NoCafRefs</span></a></span><span>
</span><span id="line-1147"></span><span>    </span><span id="local-6989586621681055726"><span class="annot"><span class="annottext">field_lits :: [CmmLit]
</span><a href="#local-6989586621681055726"><span class="hs-identifier hs-var hs-var">field_lits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; CmmInfoTable
-&gt; CostCentreStack
-&gt; CafInfo
-&gt; [CmmLit]
-&gt; [CmmLit]
</span><a href="GHC.StgToCmm.Heap.html#mkStaticClosureFields"><span class="hs-identifier hs-var">mkStaticClosureFields</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055735"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055730"><span class="hs-identifier hs-var">itbl</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681055729"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="#local-6989586621681055725"><span class="hs-identifier hs-var">caf_info</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055728"><span class="hs-identifier hs-var">payload</span></a></span><span>
</span><span id="line-1148"></span><span>
</span><span id="line-1149"></span><span class="annot"><a href="GHC.Cmm.Info.Build.html#updInfoSRTs"><span class="hs-identifier hs-var">updInfoSRTs</span></a></span><span> </span><span id="local-6989586621681055721"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055721"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681055720"><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055720"><span class="hs-identifier hs-var">srt_env</span></a></span></span><span> </span><span id="local-6989586621681055719"><span class="annot"><span class="annottext">LabelMap [SRTEntry]
</span><a href="#local-6989586621681055719"><span class="hs-identifier hs-var">funSRTEnv</span></a></span></span><span> </span><span id="local-6989586621681055718"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055718"><span class="hs-identifier hs-var">caffy</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681055717"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055717"><span class="hs-identifier hs-var">top_info</span></a></span></span><span> </span><span id="local-6989586621681055716"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055716"><span class="hs-identifier hs-var">top_l</span></a></span></span><span> </span><span id="local-6989586621681055715"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681055715"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681055714"><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055714"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1150"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmInfoTable
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681055713"><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055713"><span class="hs-identifier hs-var">closure</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (CmmInfoTable, CmmDeclSRTs)
</span><a href="#local-6989586621681055712"><span class="hs-identifier hs-var">maybeStaticClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055711"><span class="hs-identifier hs-var">proc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055713"><span class="hs-identifier hs-var">closure</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1151"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmDeclSRTs
</span><a href="#local-6989586621681055711"><span class="hs-identifier hs-var">proc</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1152"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1153"></span><span>    </span><span id="local-6989586621681055710"><span class="annot"><span class="annottext">caf_info :: CafInfo
</span><a href="#local-6989586621681055710"><span class="hs-identifier hs-var hs-var">caf_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055718"><span class="hs-identifier hs-var">caffy</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#MayHaveCafRefs"><span class="hs-identifier hs-var">MayHaveCafRefs</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#NoCafRefs"><span class="hs-identifier hs-var">NoCafRefs</span></a></span><span>
</span><span id="line-1154"></span><span>    </span><span id="local-6989586621681055711"><span class="annot"><span class="annottext">proc :: CmmDeclSRTs
</span><a href="#local-6989586621681055711"><span class="hs-identifier hs-var hs-var">proc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
-&gt; CLabel -&gt; [GlobalReg] -&gt; GenCmmGraph CmmNode -&gt; CmmDeclSRTs
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055717"><span class="hs-identifier hs-var">top_info</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681055709"><span class="hs-identifier hs-var">newTopInfo</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055716"><span class="hs-identifier hs-var">top_l</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681055715"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055714"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-1155"></span><span>    </span><span id="local-6989586621681055709"><span class="annot"><span class="annottext">newTopInfo :: LabelMap CmmInfoTable
</span><a href="#local-6989586621681055709"><span class="hs-identifier hs-var hs-var">newTopInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(KeyOf LabelMap -&gt; CmmInfoTable -&gt; CmmInfoTable)
-&gt; LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a b.
IsMap map =&gt;
(KeyOf map -&gt; a -&gt; b) -&gt; map a -&gt; map b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapMapWithKey"><span class="hs-identifier hs-var">mapMapWithKey</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CmmInfoTable -&gt; CmmInfoTable
BlockId -&gt; CmmInfoTable -&gt; CmmInfoTable
</span><a href="#local-6989586621681055707"><span class="hs-identifier hs-var">updInfoTbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055717"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1156"></span><span>    </span><span id="local-6989586621681055707"><span class="annot"><span class="annottext">updInfoTbl :: BlockId -&gt; CmmInfoTable -&gt; CmmInfoTable
</span><a href="#local-6989586621681055707"><span class="hs-identifier hs-var hs-var">updInfoTbl</span></a></span></span><span> </span><span id="local-6989586621681055706"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055706"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681055705"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055705"><span class="hs-identifier hs-var">info_tbl</span></a></span></span><span>
</span><span id="line-1157"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681055706"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055714"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055704"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055704"><span class="hs-identifier hs-var">inf</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmDeclSRTs
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (CmmInfoTable, CmmDeclSRTs)
</span><a href="#local-6989586621681055712"><span class="hs-identifier hs-var">maybeStaticClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055704"><span class="hs-identifier hs-var">inf</span></a></span><span>
</span><span id="line-1158"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055705"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cit_srt :: Maybe CLabel
</span><a href="GHC.Cmm.html#cit_srt"><span class="hs-identifier hs-var">cit_srt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CLabel -&gt; Maybe CLabel
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681055706"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055720"><span class="hs-identifier hs-var">srt_env</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1159"></span><span>
</span><span id="line-1160"></span><span>    </span><span class="hs-comment">-- Generate static closures [FUN].  Note that this also generates</span><span>
</span><span id="line-1161"></span><span>    </span><span class="hs-comment">-- static closures for thunks (CAFs), because it's easier to treat</span><span>
</span><span id="line-1162"></span><span>    </span><span class="hs-comment">-- them uniformly in the code generator.</span><span>
</span><span id="line-1163"></span><span>    </span><span class="annot"><a href="#local-6989586621681055712"><span class="hs-identifier hs-type">maybeStaticClosure</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDeclSRTs"><span class="hs-identifier hs-type">CmmDeclSRTs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1164"></span><span>    </span><span id="local-6989586621681055712"><span class="annot"><span class="annottext">maybeStaticClosure :: Maybe (CmmInfoTable, CmmDeclSRTs)
</span><a href="#local-6989586621681055712"><span class="hs-identifier hs-var hs-var">maybeStaticClosure</span></a></span></span><span>
</span><span id="line-1165"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055702"><span class="annot"><span class="annottext">info_tbl :: CmmInfoTable
</span><a href="#local-6989586621681055702"><span class="hs-identifier hs-var">info_tbl</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span class="hs-special">{</span><span id="local-6989586621681055696"><span id="local-6989586621681055697"><span id="local-6989586621681055698"><span id="local-6989586621681055699"><span id="local-6989586621681055700"><span class="annot"><span class="annottext">Maybe (Id, CostCentreStack)
Maybe CLabel
SMRep
CLabel
ProfilingInfo
cit_prof :: CmmInfoTable -&gt; ProfilingInfo
cit_clo :: Maybe (Id, CostCentreStack)
cit_srt :: Maybe CLabel
cit_prof :: ProfilingInfo
cit_rep :: SMRep
cit_lbl :: CLabel
cit_srt :: CmmInfoTable -&gt; Maybe CLabel
cit_clo :: CmmInfoTable -&gt; Maybe (Id, CostCentreStack)
cit_lbl :: CmmInfoTable -&gt; CLabel
cit_rep :: CmmInfoTable -&gt; SMRep
</span><a href="GHC.Cmm.html#cit_prof"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-1166"></span><span>           </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmInfoTable -&gt; Maybe CmmInfoTable
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055714"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681055717"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1167"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681055694"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681055694"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055693"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681055693"><span class="hs-identifier hs-var">ccs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, CostCentreStack)
</span><a href="#local-6989586621681055696"><span class="hs-identifier hs-var">cit_clo</span></a></span><span>
</span><span id="line-1168"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SMRep -&gt; Bool
</span><a href="GHC.Runtime.Heap.Layout.html#isStaticRep"><span class="hs-identifier hs-var">isStaticRep</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055699"><span class="hs-identifier hs-var">cit_rep</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1169"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-1170"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681055692"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055692"><span class="hs-identifier hs-var">newInfo</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681055691"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055691"><span class="hs-identifier hs-var">srtEntries</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap [SRTEntry] -&gt; Maybe [SRTEntry]
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055714"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap [SRTEntry]
</span><a href="#local-6989586621681055719"><span class="hs-identifier hs-var">funSRTEnv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1171"></span><span>            </span><span class="annot"><span class="annottext">Maybe [SRTEntry]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1172"></span><span>              </span><span class="hs-comment">-- if we don't add SRT entries to this closure, then we</span><span>
</span><span id="line-1173"></span><span>              </span><span class="hs-comment">-- want to set the srt field in its info table as usual</span><span>
</span><span id="line-1174"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055702"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cit_srt :: Maybe CLabel
</span><a href="GHC.Cmm.html#cit_srt"><span class="hs-identifier hs-var">cit_srt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CLabel -&gt; Maybe CLabel
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph CmmNode -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph CmmNode
</span><a href="#local-6989586621681055714"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap CLabel
</span><a href="#local-6989586621681055720"><span class="hs-identifier hs-var">srt_env</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1175"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681055690"><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055690"><span class="hs-identifier hs-var">srtEntries</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
-&gt; SDoc -&gt; (CmmInfoTable, [CmmLit]) -&gt; (CmmInfoTable, [CmmLit])
forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var">srtTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maybeStaticFun&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmLit] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055689"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1176"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055702"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cit_rep :: SMRep
</span><a href="GHC.Cmm.html#cit_rep"><span class="hs-identifier hs-var">cit_rep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055688"><span class="hs-identifier hs-var">new_rep</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055689"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1177"></span><span>              </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681055689"><span class="annot"><span class="annottext">res :: [CmmLit]
</span><a href="#local-6989586621681055689"><span class="hs-identifier hs-var hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055687"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.Build.html#SRTEntry"><span class="hs-identifier hs-type">SRTEntry</span></a></span><span> </span><span id="local-6989586621681055687"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055687"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[SRTEntry]
</span><a href="#local-6989586621681055690"><span class="hs-identifier hs-var">srtEntries</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1178"></span><span>          </span><span id="local-6989586621681055686"><span class="annot"><span class="annottext">fields :: [CmmLit]
</span><a href="#local-6989586621681055686"><span class="hs-identifier hs-var hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; CmmInfoTable
-&gt; CostCentreStack
-&gt; CafInfo
-&gt; [CmmLit]
-&gt; [CmmLit]
</span><a href="GHC.StgToCmm.Heap.html#mkStaticClosureFields"><span class="hs-identifier hs-var">mkStaticClosureFields</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681055721"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055702"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681055693"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="#local-6989586621681055710"><span class="hs-identifier hs-var">caf_info</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055691"><span class="hs-identifier hs-var">srtEntries</span></a></span><span>
</span><span id="line-1179"></span><span>          </span><span id="local-6989586621681055688"><span class="annot"><span class="annottext">new_rep :: SMRep
</span><a href="#local-6989586621681055688"><span class="hs-identifier hs-var hs-var">new_rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055699"><span class="hs-identifier hs-var">cit_rep</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1180"></span><span>             </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#HeapRep"><span class="hs-identifier hs-type">HeapRep</span></a></span><span> </span><span id="local-6989586621681055684"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055684"><span class="hs-identifier hs-var">sta</span></a></span></span><span> </span><span id="local-6989586621681055683"><span class="annot"><span class="annottext">WordOff
</span><a href="#local-6989586621681055683"><span class="hs-identifier hs-var">ptrs</span></a></span></span><span> </span><span id="local-6989586621681055682"><span class="annot"><span class="annottext">WordOff
</span><a href="#local-6989586621681055682"><span class="hs-identifier hs-var">nptrs</span></a></span></span><span> </span><span id="local-6989586621681055681"><span class="annot"><span class="annottext">ClosureTypeInfo
</span><a href="#local-6989586621681055681"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1181"></span><span>               </span><span class="annot"><span class="annottext">Bool -&gt; WordOff -&gt; WordOff -&gt; ClosureTypeInfo -&gt; SMRep
</span><a href="GHC.Runtime.Heap.Layout.html#HeapRep"><span class="hs-identifier hs-var">HeapRep</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681055684"><span class="hs-identifier hs-var">sta</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WordOff
</span><a href="#local-6989586621681055683"><span class="hs-identifier hs-var">ptrs</span></a></span><span> </span><span class="annot"><span class="annottext">WordOff -&gt; WordOff -&gt; WordOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit] -&gt; WordOff
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; WordOff
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055691"><span class="hs-identifier hs-var">srtEntries</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">WordOff
</span><a href="#local-6989586621681055682"><span class="hs-identifier hs-var">nptrs</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureTypeInfo
</span><a href="#local-6989586621681055681"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1182"></span><span>             </span><span id="local-6989586621681055679"><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681055679"><span class="hs-identifier hs-var">_other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SMRep
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maybeStaticFun&quot;</span></span><span>
</span><span id="line-1183"></span><span>          </span><span id="local-6989586621681055678"><span class="annot"><span class="annottext">lbl :: CLabel
</span><a href="#local-6989586621681055678"><span class="hs-identifier hs-var hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; CafInfo -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkLocalClosureLabel"><span class="hs-identifier hs-var">mkLocalClosureLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681055694"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="#local-6989586621681055710"><span class="hs-identifier hs-var">caf_info</span></a></span><span>
</span><span id="line-1184"></span><span>        </span><span class="hs-keyword">in</span><span>
</span><span id="line-1185"></span><span>          </span><span class="annot"><span class="annottext">(CmmInfoTable, CmmDeclSRTs) -&gt; Maybe (CmmInfoTable, CmmDeclSRTs)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681055692"><span class="hs-identifier hs-var">newInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Section -&gt; CLabel -&gt; [CmmLit] -&gt; CmmDeclSRTs
forall (raw :: Bool) info stmt.
Section
-&gt; CLabel -&gt; [CmmLit] -&gt; GenCmmDecl (GenCmmStatics raw) info stmt
</span><a href="GHC.Cmm.Utils.html#mkDataLits"><span class="hs-identifier hs-var">mkDataLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SectionType -&gt; CLabel -&gt; Section
</span><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#Data"><span class="hs-identifier hs-var">Data</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055678"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681055678"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681055686"><span class="hs-identifier hs-var">fields</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1186"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (CmmInfoTable, CmmDeclSRTs)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1187"></span><span>
</span><span id="line-1188"></span><span>
</span><span id="line-1189"></span><span id="local-6989586621681056662"><span class="annot"><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-type">srtTrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681056662"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681056662"><span class="hs-identifier hs-type">b</span></a></span></span><span>
</span><span id="line-1190"></span><span class="hs-comment">-- srtTrace = pprTrace</span><span>
</span><span id="line-1191"></span><span id="srtTrace"><span class="annot"><span class="annottext">srtTrace :: forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var hs-var">srtTrace</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681055677"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681055677"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681055677"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1192"></span><span>
</span><span id="line-1193"></span><span id="local-6989586621681056603"><span class="annot"><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-type">srtTraceM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681056603"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681056603"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-1194"></span><span id="srtTraceM"><span class="annot"><span class="annottext">srtTraceM :: forall (f :: * -&gt; *). Applicative f =&gt; String -&gt; SDoc -&gt; f ()
</span><a href="GHC.Cmm.Info.Build.html#srtTraceM"><span class="hs-identifier hs-var hs-var">srtTraceM</span></a></span></span><span> </span><span id="local-6989586621681055674"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681055674"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span id="local-6989586621681055673"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681055673"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; f () -&gt; f ()
forall b. String -&gt; SDoc -&gt; b -&gt; b
</span><a href="GHC.Cmm.Info.Build.html#srtTrace"><span class="hs-identifier hs-var">srtTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681055674"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681055673"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; f ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1195"></span></pre></body></html>